All Projects → ropensci → Magick

ropensci / Magick

Licence: other
Magic, madness, heaven, sin

Programming Languages

r
7636 projects

Projects that are alternatives of or similar to Magick

Wasm Imagemagick
Webassembly compilation of https://github.com/ImageMagick/ImageMagick & samples
Stars: ✭ 442 (+22.1%)
Mutual labels:  image-processing, image-manipulation, imagemagick
Nuxt Image Loader Module
An image loader module for nuxt.js that allows you to configure image style derivatives.
Stars: ✭ 135 (-62.71%)
Mutual labels:  image-processing, image-manipulation, imagemagick
Php Legofy
Transform your images as if they were made out of LEGO bricks.
Stars: ✭ 161 (-55.52%)
Mutual labels:  image-processing, image-manipulation, imagemagick
Stplanr
Sustainable transport planning with R
Stars: ✭ 352 (-2.76%)
Mutual labels:  r-package, rstats
Ggpointdensity
📈 📊 Introduces geom_pointdensity(): A Cross Between a Scatter Plot and a 2D Density Plot.
Stars: ✭ 286 (-20.99%)
Mutual labels:  r-package, rstats
Rplos
R client for the PLoS Journals API
Stars: ✭ 289 (-20.17%)
Mutual labels:  r-package, rstats
kaggler
🏁 API client for Kaggle
Stars: ✭ 50 (-86.19%)
Mutual labels:  rstats, r-package
Pyvips
python binding for libvips using cffi
Stars: ✭ 296 (-18.23%)
Mutual labels:  image-processing, image-manipulation
Rhub
R-hub API client
Stars: ✭ 292 (-19.34%)
Mutual labels:  r-package, rstats
Pdftools
Text Extraction, Rendering and Converting of PDF Documents
Stars: ✭ 349 (-3.59%)
Mutual labels:  r-package, rstats
Skeptick
Better ImageMagick for Ruby
Stars: ✭ 326 (-9.94%)
Mutual labels:  image-processing, imagemagick
Rnoaa
R interface to many NOAA data APIs
Stars: ✭ 278 (-23.2%)
Mutual labels:  r-package, rstats
Rselenium
An R client for Selenium Remote WebDriver
Stars: ✭ 278 (-23.2%)
Mutual labels:  r-package, rstats
Imageflow
High-performance image manipulation for web servers. Includes imageflow_server, imageflow_tool, and libimageflow
Stars: ✭ 3,643 (+906.35%)
Mutual labels:  image-manipulation, imagemagick
Menyoki
Screen{shot,cast} and perform ImageOps on the command line 🌱 🏞️
Stars: ✭ 255 (-29.56%)
Mutual labels:  image-processing, image-manipulation
Targets
Function-oriented Make-like declarative workflows for R
Stars: ✭ 293 (-19.06%)
Mutual labels:  r-package, rstats
Jekyll Gallery Generator
A Jekyll plugin that generates photo galleries from directories full of images.
Stars: ✭ 315 (-12.98%)
Mutual labels:  image-processing, imagemagick
Assertr
Assertive programming for R analysis pipelines
Stars: ✭ 355 (-1.93%)
Mutual labels:  r-package, rstats
Opence
Contrast Enhancement Techniques for low-light images
Stars: ✭ 333 (-8.01%)
Mutual labels:  image-processing, image-manipulation
worrms
World Register of Marine Species R client
Stars: ✭ 13 (-96.41%)
Mutual labels:  rstats, r-package

rOpenSci: The magick package

Advanced Image-Processing in R

Project Status: Active – The project has reached a stable, usable state and is being actively developed. Build Status AppVeyor Build Status CRAN_Status_Badge CRAN RStudio mirror downloads Github Stars

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.

Documentation

About the R package:

About the underlying library:

Hello World

Run examples in RStudio to see live previews of the images! If you do not use RStudio, use image_browse to open images. On Linux you can also use image_display to get an X11 preview.

library(magick)
frink <- image_read("https://jeroen.github.io/images/frink.png")
image_trim(frink)
image_scale(frink, "200x200")
image_flip(frink)
image_rotate(frink, 45) ## <-- result of this is shown
image_negate(frink)
frink %>% 
  image_background("green") %>% 
  image_flatten() %>%
  image_border("red", "10x10")
image_rotate(frink, 45) %>% image_write("man/figures/frink-rotated.png")

Effects

image_oilpaint(frink)
image_implode(frink)
image_charcoal(frink) ## <-- result of this is shown
image_blur(frink)
image_edge(frink)
image_charcoal(frink) %>% image_write("man/figures/frink-charcoal.png")

Create GIF animation:

# Download images
oldlogo <- image_read("https://developer.r-project.org/Logo/Rlogo-2.png")
newlogo <- image_read("https://jeroen.github.io/images/Rlogo-old.png")
logos <- c(oldlogo, newlogo)
logos <- image_scale(logos, "400x400")

# Create GIF
(animation1 <- image_animate(logos))
image_write(animation1, "man/figures/anim1.gif")

# Morph effect  <-- result of this is shown
(animation2 <- image_animate(image_morph(logos, frames = 10)))
image_write(animation2, "man/figures/anim2.gif")

Read GIF animation frames. See the rotating earth example GIF.

earth <- image_read("https://upload.wikimedia.org/wikipedia/commons/2/2c/Rotating_earth_%28large%29.gif")
length(earth)
earth[1]
earth[1:3]
earth1 <- rev(image_flip(earth)) ## How Austrialans see earth
image_write(earth1, "man/figures/earth1.gif") ## <-- result of this is shown

R logo with dancing banana

logo <- image_read("https://www.r-project.org/logo/Rlogo.png")
banana <- image_read("https://jeroen.github.io/images/banana.gif")
front <- image_scale(banana, "300")
background <- image_scale(logo, "400")
frames <- lapply(as.list(front), function(x) image_flatten(c(background, x)))
image_write(image_animate(image_join(frames)), "man/figures/Rlogo-banana.gif")

Use magick in Shiny Apps

This demo application shows how to use magick with shiny: https://github.com/jeroen/shinymagick

Installation

Binary packages for macOS or Windows can be installed directly from CRAN:

install.packages("magick")

Installation from source on Linux or OSX requires the imagemagick Magick++ library. On Debian or Ubuntu install libmagick++-dev:

sudo apt-get install -y libmagick++-dev

If you are on Ubuntu 14.04 (trusty) or 16.04 (xenial) you can get a more recent backport from the ppa:

sudo add-apt-repository -y ppa:cran/imagemagick
sudo apt-get update
sudo apt-get install -y libmagick++-dev 

On Fedora, CentOS or RHEL we need ImageMagick-c++-devel. However on CentOS the system version of ImageMagick is quite old. More recent versions are available from the ImageMagick downloads website.

sudo yum install ImageMagick-c++-devel

On macOS use [email protected] from Homebrew.

brew install [email protected]

The unversioned homebrew formulaimagemagick can also be used, however it has some unsolved OpenMP problems.

There is also a fork of imagemagick called graphicsmagick, but this doesn't work for this package.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].