Tutorial :Ruby graphic libraries



Question:

What's the difference between RMagic, ImageMagick, GD, etc. and which one should I use? I was looking for a thumbnail generation script and noticed that every script I found uses a different library for the same thing.


Solution:1

Imagemagick, GD, DevIL, and GraphicsMagick are libraries used to create and edit image files. RMagick is a ruby wrapper around ImageMagick/GraphicsMagick. You may find other wrappers

I've had luck installing and configuring GraphicsMagick (similar to ImageMagick) and using RMagick on my Mac.

Are you doing batch processing? What about logical resizing (fixed XY, max XY, percent reduction)? Image types (png, jpg, gif, bmp)? Integration with other tools (Paperclip, as mentioned above)? What's your server setup (shared host, can install libraries, etc.)?

If you provide some more details on your thumbnail generation needs and your setup that might help give you a better answer, but I'd suggest giving at least GraphicsMagick and ImageMagick a try, along with mini_magick or rmagick. Imagescience sounds interesting to me too though...


Solution:2

Stay away from ImageMagick if possible, there are other lighter weight ones, ImageScience, DevIL, and so on


Solution:3

I've had good luck with ImageScience in the past, though really ImageMagick isn't all that bad (if big), and might be what is available on shared hosting.


Solution:4

The answer might also depend on what other gems you are using. For example, if you use Paperclip for uploading files then it would be better to use ImageMagick as that is the library that Paperclip uses to process files.


Solution:5

If I were you, I would stay away from Rmagick/Imagemagick. I had a similar need in my rails application, to show the activity of user as a graph. I tried and failed to get both Gruff/Scruffy working, both depend on Rmagick. I finally gave up and used jQuery/Flot and it produces beautiful graphs.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »