Page 1 of 1

How can I do a reverse "append"? (color quantization)

Posted: 2013-01-05T22:05:35-07:00
by imhere
Edit: This is what I am trying to do:

Example workflow: (20) "100x100" png files -> append into (1) "100x2000" png -> convert to gif -> split back into (20) "100x100" gif files.

I don't know how I would do that last step. I am working on a windows laptop.

Why do I want to do that last step? Because...

Recently I have been trying various image editing tools to create animated gifs. I am using GIMP as my main editor, but found the built-in conversion to 256-color gif to be mediocre. Tried gmic plugin, did not like the results. Tried ximagic plugin, great but it's shareware and I think only works on single image at a time. Tried RIOT plugin, good but also only works on single image at a time. Tried gifsicle, too speckled. So trying imagemagick now, the gif results look better than other free tools except for RIOT. Not sure what quantization method IM uses (is it octree?), but the neuquant method available from RIOT still looks better to me.

So what I am thinking now is create/edit my project in gimp, then save the finished layers/frames as separate png files. Then I "append" all the png frames into 1 single image with imagemagick. Then I can color quantize the appended file into 256 color gif with RIOT instead of IM. But this would only be useful if I can split the appended image back into layers/frames after.

Re: How can I do a reverse "append"? (color quantization)

Posted: 2013-01-05T22:22:17-07:00
by fmw42
convert animation.gif -coalesce images_%d.png

or

convert animation.gif -coalesce +adjoin images_%d.gif

PNG does not support multi-frame files, so it does not need to have +adjoin (though it will not hurt to include it anyway).

see
http://www.imagemagick.org/script/comma ... p#coalesce
http://www.imagemagick.org/script/comma ... php#adjoin
http://www.imagemagick.org/Usage/anim_basics/
http://www.imagemagick.org/Usage/anim_basics/#coalesce

Re: How can I do a reverse "append"? (color quantization)

Posted: 2013-01-05T22:58:06-07:00
by imhere
Thanks for the reply. Hmm I don't think coalesce will do what I am thinking of. My understanding is coalesce reverses whatever was done by "-layers optimize". But what I want to do is reverse what an "append" does. Append takes multiple images and concats them into one single image. I want to further procees this single image then split it back into multiple images. Example workflow: (20) "100x100" png files -> append into (1) "100x2000" png -> convert to gif -> split back into (20) "100x100" gif files.

Re: How can I do a reverse "append"? (color quantization)

Posted: 2013-01-06T02:58:20-07:00
by snibgo
convert -crop 1x20@ x_%02d.gif

Re: How can I do a reverse "append"? (color quantization)

Posted: 2013-01-06T06:02:55-07:00
by imhere
Thank you snibgo. Yes that is what I was looking for. I did see the commands crop/chop in the command-line options page, but thought it would have to be recalculated/repeated manually. After looking further into crop command, the examples page does a good job visually showing what is capable.

Re: How can I do a reverse "append"? (color quantization)

Posted: 2013-01-06T16:20:06-07:00
by snibgo
For some reason, the "@" facility isn't mentioned on http://www.imagemagick.org/script/comma ... s.php#crop . As it is so useful, perhaps whoever maintains that page might mention it. (Hint, if anyone is listening.)

Re: How can I do a reverse "append"? (color quantization)

Posted: 2013-01-06T18:11:02-07:00
by anthony
It is metioned but further down. the '@' was one of the later additions added to the operator

Cropping into roughly Equally Sized Divisions
http://www.imagemagick.org/Usage/crop/#crop_equal

It also has a lot of extra features, such as gaps, and overlaps, as well how how 'edges' should be handled.

more specifically see
Separating Spaced-out Tiling Images
http://www.imagemagick.org/Usage/crop/#crop_spaced

Re: How can I do a reverse "append"? (color quantization)

Posted: 2013-01-06T18:47:56-07:00
by snibgo
anthony wrote:It is metioned but further down.
So it is. My apologies.