Page 1 of 1

Merging rotated gif onto background gives color differences

Posted: 2008-11-24T03:28:27-07:00
by fommes
Hi there,

I use the following code to rotat a gif image:

convert imageframe.gif -background none -rotate $rotation -transparent white overlay_images/tmpImages/rotation_{$tempimage}_{$i}.gif"

Now what i do in short, i make 4 frames with this and then merge the 4 on a certain background and then merge the whole into one animated gif and the result you wil get is :

non rotated animation on a background:
http://fotobling.fotopocket.nl/view.php?id=42

rotated using imagemagick on a background:
http://fotobling.fotopocket.nl/view.php?id=41

As you can see the product quality of the rotated version is lower then without a rotated gif it seems that the palletes of the 4 merged gifs are different somehow, is there some method i can use to stop the pixels from changing color ?

Thanks in advance!

Re: Merging rotated gif onto background gives color differences

Posted: 2008-11-24T11:55:51-07:00
by fmw42
Use a common colortable with or without dithering via -map

see http://www.imagemagick.org/Usage/quantize/#map

Re: Merging rotated gif onto background gives color differences

Posted: 2008-11-24T15:50:08-07:00
by anthony
rotateing does produce a much larger color map. That is the nature of any image distortion be it rotates or resizes. You will need to
fix the color name if that is what you need.

Re: Merging rotated gif onto background gives color differences

Posted: 2008-11-25T02:49:26-07:00
by fommes
How would i change the color name 'automated' ?
If you take a look at http://fotobling.fotopocket.nl visitors can upload a picture and add the animated gifs on top of it, in a flash environment, when they hit save the image should be created (rotating any rotated gifs, then merging it all together into a animated version)
Is there a way to get all the colors the same for each frame? maybe get the colortable for the first frame, and then add it to the next frame ?

Re: Merging rotated gif onto background gives color differences

Posted: 2008-11-25T12:09:49-07:00
by fmw42
fommes wrote:How would i change the color name 'automated' ?
If you take a look at http://fotobling.fotopocket.nl visitors can upload a picture and add the animated gifs on top of it, in a flash environment, when they hit save the image should be created (rotating any rotated gifs, then merging it all together into a animated version)
Is there a way to get all the colors the same for each frame? maybe get the colortable for the first frame, and then add it to the next frame ?

see -map and related discussion

http://www.imagemagick.org/Usage/quantize/#map

The first image can be the colortable for all the rest of the image when using -map

Re: Merging rotated gif onto background gives color differences

Posted: 2008-11-25T16:13:45-07:00
by anthony
Especially note +map for animations. That will ensure a command global color map is used rather thna individual (slightly different) local color maps, even for the same given color map.

Re: Merging rotated gif onto background gives color differences

Posted: 2008-11-26T02:52:52-07:00
by fommes
Thanks alot fmw42 and anthony i'll try it today!

Re: Merging rotated gif onto background gives color differences

Posted: 2008-11-26T03:43:09-07:00
by fommes
Hi!

I got it working now, i -map the rotated gif with the colortable of the original version of the gif, then i merge it onto the background

result:

http://fotobling.fotopocket.nl/view.php?id=58

Thanks for all the help!