[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?
jcewy at swbell.net
Fri Jan 15 10:20:34 EST 2010
Robert Gault wrote:
> RJLCyberPunk wrote:
>> I know there are viewers but are there applications that preferably
>> can run on a PC and convert JPG,BMP etc files to a Coco picture file
>> say a CoCo 3 picture file that one could then use in a program, game
>> etc? If so please let me know where I can obtain or preferably
>> download it from thanks...
> Most PC graphic editors should be able to do what you want. You do
> need to specify whether you intend to use an RGB monitor or artifact
> color on an NTSC composite monitor. Conversion to an RGB Coco format
> is easy. Conversion to the NTSC artifact modes is much more difficult
> but still possible.
For my slideshow, I got a palette file from Jason Law that has been made
to closely approximate the set of artifact colors displayed on an NTSC
monitor using the following CoCo 3 palette in the 640x200x4-color mode:
00 10 20 30 (hex). This palette file was developed for use in Paintshop
Pro, but it can also be used in other programs. I loaded it into GIMP
I used GIMP to scale each image to 160x200 (changing the aspect ratio
for the non-square pixels of that pseudo-mode), convert the images to
indexed, using the CoCo 3 256 color palette, and then exported the
images in 8-bit Targa (TGA) format. Then I removed the header and
footer data, resulting in a raw pixel map, copied the images to CoCo
disk images, and used 'merge' in NitrOS-9 to add an appropriate VEF
header. (The latter could just as easily have been done with 'cat' on
the PC, but I judged it to be easier to create my header file in OS-9,
so I saved a step by having to copy the header to the PC.)
Much of this could be automated. I have written Perl scripts to do
similar things using NETPBM tools on multiple images. One will take a
directory of arbitrarily sized JPEGs and scale them to 320x200 and
convert them to 256-color BMP files for Sockmaster's Hi-Color display
program. This is similar to what John Linville has done using ImageMagick.
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
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.
-- Aside to Linville: Apparently ImageMagick doesn't have this feature?
Of course, you haven't said that you want to use the 640/160x200
artifact mode, but other modes would be done similarly.
> Here is one method. Convert your image to BMP format, reduce the size
> and color count to 320x192x16 using Windows colors, invert the image,
> and save it. Use a raw file editor to remove the BMP header. Now the
> file can be loaded into HSCREEN2. You will need to adjust palette colors.
> Go to Coco3.com and study the threads on the 640x4 artifact mode for a
> method using NTSC monitors and artifact colors.
> Coco mailing list
> Coco at maltedmedia.com
More information about the Coco