# Small graphics library?

**URL:** <https://www.ruby-forum.com/t/small-graphics-library/195829>\
**Category:** Ruby\
**Created:** [September 30, 2010, 10:05pm UTC](https://www.ruby-forum.com/t/small-graphics-library/195829 "2010-09-30T22:05:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![quintus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/q/49beb7/32.png) [@quintus](https://www.ruby-forum.com/u/quintus)\
**Post date:** [September 30, 2010, 10:05pm UTC](https://www.ruby-forum.com/t/small-graphics-library/195829/1 "2010-09-30T22:05:41Z")

</div>

-----BEGIN PGP SIGNED MESSAGE-----  
Hash: SHA1

Hi there,

Does somebody know about a rather small graphics library for Ruby?  
RMagick is way to big and complicated to install for my purposes (just  
rectangular picture cutting and pasting in PNG images) and additionally  
it is complicated to install for Ruby 1.9 on Windows which is a  
must-have criterium as the application will be distributed not only on  
Linux systems, but also on Windows ones (by means of using OCRA).

Vale,  
Marvin  
-----BEGIN PGP SIGNATURE-----  
Version: GnuPG v1.4.10 (GNU/Linux)  
Comment: Using GnuPG with Mozilla - [http://enigmail.mozdev.org/](http://enigmail.mozdev.org/)

iQEcBAEBAgAGBQJMpO0MAAoJEGrS0YjAWTKVMr0H/3TpKKLJRk2HlMlUmPuZIN28  
rPNg2TbFn82RlGYZHOqJTMaZoQeLjnjrJDBZVY9+DL/ql5BcmGQsMuXTM8ZFDTH/  
w4zuRAfBlDCFoQek1c095e04iW6Zxo8Tl096r0LI1p6iRZ0FoSn1BnuMPLiCaaV0  
m9kRS+4UzKytfTlXwme+SM86Akdu/IAGGVdnEWE5/X0Ictb1tmHKI8CTCT7kq+s8  
4rMdkOTIqARS50Yc/FFz+NXAeqP8ixp3KTcmMa7id7NLPYSsnpKu8bf+MZkcbC5i  
5v1+qZUXG73LzsBUwtNdJrUbTvEklNeJhbXXQkmQHYcyGRstejvVKImy+zQUFy0=  
=s3ce  
-----END PGP SIGNATURE-----

---

<div class="post-metadata">

**Author:** ![quintus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/q/49beb7/32.png) [@quintus](https://www.ruby-forum.com/u/quintus)\
**Post date:** [September 30, 2010, 11:03pm UTC](https://www.ruby-forum.com/t/small-graphics-library/195829/2 "2010-09-30T23:03:19Z")

</div>

> Does somebody know about a rather small graphics library for Ruby?  
> RMagick is way to big and complicated to install for my purposes (just  
> rectangular picture cutting and pasting in PNG images) and additionally  
> it is complicated to install for Ruby 1.9 on Windows which is a  
> must-have criterium as the application will be distributed not only on  
> Linux systems, but also on Windows ones (by means of using OCRA).

The only thing I can think of would be to ‘wrap’ java’s built in  
graphics2d class.

Some other useful things that come to mind:

> **[Category: Graphing - The Ruby Toolbox](https://www.ruby-toolbox.com/categories/graphing.html)**
>
> Explore and compare open source Ruby libraries

> **[GitHub - tarcieri/SmartImage: It's like a Swiss Army Knife for images, but...](https://github.com/tarcieri/SmartImage)**
>
> It's like a Swiss Army Knife for images, but one of those tiny ones you can keep on your keychain - GitHub - tarcieri/SmartImage: It's like a Swiss Army Knife for images, but one of those t...

---

<div class="post-metadata">

**Author:** ![quintus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/q/49beb7/32.png) [@quintus](https://www.ruby-forum.com/u/quintus)\
**Post date:** [October 1, 2010, 4:04am UTC](https://www.ruby-forum.com/t/small-graphics-library/195829/3 "2010-10-01T04:04:24Z")

</div>

On 09/30/2010 01:04 PM, Quintus wrote:

> Does somebody know about a rather small graphics library for Ruby?

[http://seattlerb.rubyforge.org/ImageScience.html](http://seattlerb.rubyforge.org/ImageScience.html)

does this help? haven’t used it myself…

---

<div class="post-metadata">

**Author:** ![quintus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/q/49beb7/32.png) [@quintus](https://www.ruby-forum.com/u/quintus)\
**Post date:** [October 1, 2010, 5:39pm UTC](https://www.ruby-forum.com/t/small-graphics-library/195829/4 "2010-10-01T17:39:05Z")

</div>

-----BEGIN PGP SIGNED MESSAGE-----  
Hash: SHA1

Am 01.10.2010 04:02, schrieb Joel VanderWerf:

> On 09/30/2010 01:04 PM, Quintus wrote:
> 
> > Does somebody know about a rather small graphics library for Ruby?
> 
> [http://seattlerb.rubyforge.org/ImageScience.html](http://seattlerb.rubyforge.org/ImageScience.html)
> 
> does this help? haven’t used it myself…

That one looks really good, but it seems it can’t handle the case of  
_adding_ something to a picture, i.e. suppose I have two images from the  
same size, say 10px_10px, and now I want to place the second one below  
the first one so I get a 10px_20px image I then save out to disk.  
Maybe it’s possible to convert the PNG to something simpler first I can  
work directly with as a string and afterwards converting the result back  
to PNG, but I’d like to do it in a clean way–and for bigger images  
converting in such simple formats causes quite big strings I think.  
Additionally, the back-and-forth converting itself will take some time  
and even if that’s not a critical issue in my case, I don’t want to do  
unnecessary operations like this.

However, I just found a gem that perfectly fits my needs[1]: chunky\_png  
( [chunky\_png | RubyGems.org | your community gem host](http://rubygems.org/gems/chunky_png) ).

Thanks to everyone!

Vale,  
Marvin

[1] The paste problem is accessed by chunky\_png by just directly  
operating on the pixels. This maybe slow, but seems to me like a very  
clean way and chunky\_png does not have any external dependencies which  
makes it even more attractive to me. However, if you have better ideas,  
I’m always open to new suggestions.  
-----BEGIN PGP SIGNATURE-----  
Version: GnuPG v1.4.10 (GNU/Linux)  
Comment: Using GnuPG with Mozilla - [http://enigmail.mozdev.org/](http://enigmail.mozdev.org/)

iQEcBAEBAgAGBQJMpgABAAoJEGrS0YjAWTKVXTsIAIktJelnYkiCBuLvg61pe9om  
hBtEo6g2v4D6GhZ7JLkKO7osoickfNNXvGTxWmgE+zoS2pIig2U4aXh6c2qGqa2x  
B1SvS2uGDXQ6lu3rghxca90WJ/jx8YABVA/AfIYwgLPWN7ToxbEGdDYVzf3RyV7P  
jQeK2C2MWfut7zhCBoYMIqOypTaW5BcIkyUlbZNmjAXYDK49McsSW2fNuFL8dkzi  
LcfBA8nj/m1P/Pe5q/57YuSgigHCf733SLgS83ySJrPDeapnn8Va0zT9HmY/HAMi  
WESa6yjY+L+4CCpQpIHl9QgY8W27RlKPz0OpzihFsGkjA4N44RmzlKIBs1ugkZ4=  
=PI++  
-----END PGP SIGNATURE-----
