[Coco] Is there a way to import JPGs or BMPs to a CoCo picture file format that can be used in a program, game etc?

John W. Linville linville at tuxdriver.com
Fri Jan 15 11:03:34 EST 2010


On Fri, Jan 15, 2010 at 09:20:34AM -0600, Joel Ewy wrote:

> The only reason I haven't reworked my cocoscale.pl to make these 256  
> artifact color pictures is this quote from the documentation for  
> 'pnmremap,' the NETPBM tool for making an RGB image into an indexed 
> image:
>
> "For historical reasons, Netpbm sometimes calls the palette a  
> "colormap." But it doesn't really map anything. *pnmremap* creates its  
> own map, based on the palette, to map colors from the input image to  
> output colors."
>
> For the fixed palette file to work correctly, the output image must be  
> indexed to the palette in the same order.  The above quote seems to  
> suggest that pnmremap sees the palette file as a mere suggestion and may  
> not do an ordered mapping to it.

Yeah, if it kept the same set of colors but swizzled the ordering
then it wouldn't help you much.  Of course, if your PC-based program
used a different/better/preferred dithering algorithm then even if it
swizzled the colors you could run the image through that tool then use
some version of my tools (w/o the dithering) to remap the colors back
to their original indexes -- pretty sure that would work.  Or if you
aren't that picky, you can just use my tools w/ the Floyd-Steinberg
dithering... :-)

> -- Aside to Linville:  Apparently ImageMagick doesn't have this feature?

I'm pretty sure it does:

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

But that makes it look like you'd need to feed it a GIF rather than the
.pal file -- not sure.  I did the mapping in my tool partly because
I'm not that familiar with the available tools and partly because I
wanted to learn more about how colors are matched algorithmically. :-)

John
-- 
John W. Linville		Someday the world will need a hero, and you
linville at tuxdriver.com			might be all we have.  Be ready.



More information about the Coco mailing list