Advanced Graphics and Image-Processing in R

Bindings to 'ImageMagick': the most comprehensive open-source image processing library available. Supports many common formats (png, jpeg, tiff, pdf, etc) and manipulations (rotate, scale, crop, trim, flip, blur, etc). All operations are vectorized via the Magick++ STL meaning they operate either on a single frame or a series of frames for working with layers, collages, or animation. In RStudio images are automatically previewed when printed to the console, resulting in an interactive editing environment. The latest version of the package includes a native graphics device for creating in-memory graphics or drawing onto images using pixel coordinates.


News

1.6

  • Automatically repage transformations that may modify image size
  • Added image_repage() to be consistent with command line tool
  • image_composite() now vectorizes over both 1st and 2nd argument
  • Support EBImage S4 Image class in image_read() and as_EBImage()
  • Fix a bug where 1 channel image array would read as 'Green' instead of 'Gray'
  • Include alpha channel in as.raster() for magick images
  • Export image_data() function to export raw bitmap data
  • Round the clipping coordinates to fix problem with 1px edge around graphics
  • Reset clipping area when magick graphics device is closed or starts new page
  • Change default colorspace for image_quantize() to RGB which is safer
  • Breaking: 'fuzz' parameter rescaled to be a percentage (0-100)
  • Add image_strip() as well as 'strip = TRUE' paremeter to image_read()
  • Adding image_blank() to create empty images
  • Graphics device: hardcode font aliases for families used by R, issue #80
  • Better font family lookup in graphics and image_annotate()
  • Switch to DrawableRotation() api for rotation in text and graphics
  • Autobrew: build gdk-pixbuf without modules (for rendering svg with rasters)
  • New functions option_types() and option_values() to list possible options
  • Drop support for GraphicsMagick (it never really worked)
  • RStudio viewer: convert to png for unsupported formats

1.5

  • Add knit_print.magick-image() method so that images automatically appear in knitr docs
  • Adding vignette examples for image_modulate() and image_convolve()

1.4

  • Windows/OSX: update imagemagick fixes a rare png writing bug
  • Set MAGICK_TMPDIR to match R session tempdir() instead of global TMPDIR
  • Explicitly set channels in image_negate() for IM7 compatibility
  • Added image_channel() to extract a single channel from an image
  • Added new image_convolve() function

1.3

  • Automatically import + export magrittr::%>% for easy pipelining
  • Fix 'zero-configuration' in magick_config() to use the proper macro
  • BREAKING: image_compare() now returns an image with a 'distortion' attribute
  • Workaround for broken std::string(Magick::Color) in GCC-7

1.2

  • Documentation! Split manuals into meaningful pages
  • Windows / MacOS: update ImageMagick to 6.9.9-9 (fixes a png bug and one for linejoins)
  • Added image_modulate() for setting brightness, saturation, hue
  • Added image_quantize() option for reducing number of colors in an image
  • Added image_resize() which supports custom resize filters
  • image_border() now takes a operator parameter, fixes transparency bug
  • image_write() gains a parameter 'comment' to add metadata to the file
  • image_convert() gain 'type' and 'colorspace' parameters e.g. to convert to grayscale
  • image_animate() has been merged with image_coalesce()

1.1

  • Change default 'bg' in image_graph() to 'white'
  • Fix positioning of rasterImage() when raster image is rotated
  • Use TriangleFilter for interpolating rasterImage()
  • Improve support for 'symbol' fonts (metrics are still not 100%)
  • Rotate text using affine transformations
  • image_composite() gains a 'composite_args' parameter needed for e.g. blend
  • Fix support for demo images e.g. image_read("wizard:") or image_read("logo:")

1.0

  • Vectorize image_draw() (all drawing should be applied to each frame)
  • Rename 'image_device' to 'image_graph'
  • Add 'antialias' parameter to image_graph() and image_draw() and image_convert()
  • New function image_apply() to apply a transformation to each frame individually
  • New function image_ocr() for easy text extraction
  • Added image_despeckle(), image_median(), image_reducenoise() (tnx Noam Ross)
  • image_background() now flattens each frame by default
  • Support dev.capture() for in image_graph() and image_draw() device
  • Support type nativeRaster, raster, and matrix in image_read()
  • Drawing rasters reimplemented DrawableCompositeImage()
  • OSX: Fix performance issue with font caching
  • Windows: Fix performance issue with font rendering
  • Windows: Add back support for gcc-4.6.3 on Windows

0.5

  • NEW: native graphics device for producing images! See ?magick_device
  • NEW: easy drawing on top of images using magick_draw()
  • Windows: updated build to 6.9.9-3
  • Various fixes to support upcoming IM7 (IM6 is still recommended)
  • Update vignette with new features

0.4

  • Extract autobrew script

0.3

  • Add [<-.magick-image to support for assigning layers to image by index
  • Revert Windows build to ImageMagick 6 because IM7 is too buggy
  • Add plot(image) method
  • Added intro vignette

0.2.2

  • Try again to fix the mac binary package
  • Switch the Windows package to ImageMagick 7

0.2.1

  • Try to fix the mac binary package

0.2

  • Build binary package on OS-X --with-zero-configuation (fixes "config xml file" errors).
  • image_read now reads straight from disk rather than via R.
  • Add as.raster() method for images
  • image_write gains a 'flatten' argument
  • Lots of small tweaks here and there

0.1

  • Initial CRAN release

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("magick")

2.0 by Jeroen Ooms, 19 days ago


https://github.com/ropensci/magick#readme


Report a bug at https://github.com/ropensci/magick/issues


Browse source code at https://github.com/cran/magick


Authors: Jeroen Ooms [aut, cre]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports Rcpp, magrittr, curl

Suggests av, spelling, jsonlite, methods, knitr, rmarkdown, rsvg, webp, pdftools, ggplot2, raster, rgdal, gapminder, IRdisplay, tesseract, gifski

Linking to Rcpp

System requirements: ImageMagick++: ImageMagick-c++-devel (rpm) or libmagick++-dev (deb)


Imported by FloodMapper, MSbox, MtreeRing, carbonate, ggimage, lime, mathpix, meme, metaDigitise, multipanelfigure, r4lineups, splashr, texPreview.

Suggested by IsoriX, cowplot, dlib, exams, facerec, gridGraphics, hypervolume, ijtiff, kableExtra, mem, memapp, memery, pkgdown, popdemo, rgl, roundhouse, rtweet, tesseract, usethis.


See at CRAN