How to extract frames from a GIF file preserving frame dimensions
Use the -coalesce option: convert -coalesce brocoli.gif out%05d.pgm
Use the -coalesce option: convert -coalesce brocoli.gif out%05d.pgm
You need to install Ghostscript in order to rasterize vector files (PDF, EPS, PS, etc.) with ImageMagick. IM will shell out to Ghostscript when doing these manipulations (you can see it if you use the -verbose tag in your IM invocation). You could also use Ghostscript by itself to rasterize vector files.
It appears it’s a problem reported on the Homebrew github repo (https://github.com/mxcl/homebrew/issues/16625) blaming rmagick itself not supporting newer versions of imagemagick. On that same issue (https://github.com/mxcl/homebrew/issues/16625#issuecomment-11519383), you can find this link: https://coderwall.com/p/wnomjg which actually worked for me. This is what he does: cd /usr/local/Cellar/imagemagick/6.8.0-10/lib ln -s libMagick++-Q16.7.dylib libMagick++.dylib ln -s libMagickCore-Q16.7.dylib libMagickCore.dylib ln -s libMagickWand-Q16.7.dylib … Read more
I used -extent to do this: convert input.jpg -gravity center -background white -extent 50×50 output.jpg
I had this error when rendering an image using DragonFly in Rails. This happened after I upgraded to Lion (ImageMagick was installed using Brew). I reinstalled ImageMagick, jpeg, libtiff and jasper (reinstalling ImageMagick wasn’t enough by itself). brew uninstall imagemagick jpeg libtiff jasper brew install imagemagick Prior to that, running identify -list format and jpeg … Read more
convert <img_in> -set colorspace Gray -separate -average <img_out> gives the best result for any image for me.
Looks like you’re missing ghostscript. If you are using Homebrew you can install it via: $ brew install ghostscript
To restrict the resulting image to a maximum file size, you can use the commandline parameter -define jpeg:extent=max_value, like this: convert original.jpeg -define jpeg:extent=300kb output.jpg convert original.jpeg -define jpeg:extent=300kb -scale 50% output.jpg convert original.jpeg -define jpeg:extent=300kb […other options…] output.jpg Note, this will not always work to match the exact size you wanted. You may have … Read more
convert input.gif -coalesce -repage 0x0 -crop WxH+X+Y +repage output.gif Animated gifs are often optimised to save space, but imagemagick doesn’t seem to consider this when applying the crop command and treats each frame individually. -coalesce rebuilds the full frames. Other commands will take into consideration the offset information supplied in the original gif, so you … Read more
Add this option to convert: -background transparent However, keep in mind that your original image must actually have an alpha channel. PNGs may have an alpha channel, JPEGs do not.