I am trying to wite a Ruby script for batch processing images with RMagick. But when I use for exaple this code:
img = ImageList.new('in.gif').first
pixels = img.get_pixels(0,0,img.columns,img.rows)
img.store_pixels(0,0, img.columns, img.rows, pixels)
img.write('out.gif');
I expect my image stay unchanged, but it looses it's transperency turning it into black. How do I correctly process gifs with transparency with RMagick?
EDIT: Here is my image: https://i.sstatic.net/9lPWn.gif
If it's usefull the virsion I used are: Rmagick gem - 2.13.2 Ruby - 2.1.2 ImageMagick 6.7.7-10 Ubuntu 13.10
EDIT2: I found that this actually doesn't occur for all my images but rather for that exactly image and other of this small size. Maybe something is wrong with processing small gifs?
It appears it's really a bug in ImageMagick itself. I don't know if it's fixed in 6.8, it was easier for me to just convert my images to png. With png it works fine. The bug is related to editing small like 16x16 gif images with transparency.