View Single Post
Old 17 April 2015, 07:48   #1
Newbie Amiga Programmer

Join Date: Jun 2012
Location: Front of my A500+
Posts: 56
new PNG to ILBM converter for Amiga, MorphOS, Linux, FreeBSD, Haiku and Solaris

I've just released my PNG to ILBM converter.

There's some basic usage examples. All of the converted images are converted from this image:
With the exception of Amiga, which converted a pre-shrinked version of this image. (Due the limited memory in my A500+, it wasn't able to deal with a HD image.)

The converter supports resampling, quantizing and dithering to any bitplanes, used by the Amiga, including EHB.

For example:
png2ilbm ferrari.png ferrari_ehb.iff -w=320 -d -bp=ehb
(I show the result pictures converted back to PNG, to make them viewable from browser, but there are also links to the IFF files.)


The converter also supports hi-res/laced pictures:

png2ilbm ferrari.png ferrari_8hril.iff -w=640 -bp=8 -hr -il -d


If there is a need to convert a picture which can only use certain registers, then the others can be preserved:
png2ilbm ferrari1.png ferrari_5pr.iff -d -bp=5 -pr=0-7,17-19
With this line, a 5-bit picture is converted from the original, but colour registers 0-7 and 17-19 are preserved, thus the image uses only 21 colours.
(If the target bitplane number is EHB, then the preserved registers will extended to the upper 32 imaginary registers too, since if e.g. register 11 is unusable, then register 43 will be unusable too.)


It's possible to override colour register during quantization. These registers will be also preserved during the quantization, but then they will be used during the colour replacing.
It can be used for partial colour adds (for example if the picture can use the registers used for other purposes, but cannot overwrite them), but also can be used to quantize to a fixed palette.

png2ilbm ferrari.png ferrari_c64.iff -w=320 -d -bp=8 -srl=c64-136.pal
This picture uses the Commodore 64's 136 coloured palette.


To use override from CLI, use the "sr" switch, the "srl" is to load the override list from a file. The format for them is identical: register:colour,register:colour,register:colour...

All of the generated pictures uses 24-bit palettes, but the converter can forced to convert them to 12-bit ones. The non-AGA Amigas are able to show the 24-bit palettes, but they only use the top 4-bit, which are not colour-correct shrinking, since for example $e1 will be $e, but in reality it should be $d ($e1 is much closer to $dd than $ee).
So, with the "f4b" switch the converter will colour-correctly shrink all the colours, then extend them again (also colour-correctly). By this the non-AGA machines will show the colours without brightness shifting.
However, since the quantizer works on 24 bit and the shrinking happens after the palette quantization, it can produce collosions, which can be more worse, than a non-correctly bright picture. (E.g. both the colours "3f89b1" and "4590a9" will be "4488aa" and the final image will use less colours.) So, use with care.

Binaries can be downloaded the for all supported platform from there: (The uncompressed binaries are weigh 'round 60-70 kB on every platform.)
Currently supported platforms are Amiga, Linux, Haiku, FreeBSD, MorphOS and Solaris on x86 and PPC architectures (Amiga is 68k of course). Further platforms (OSX, OS4) and archs (PPC64, Sparcs) will be supported, whenever i'll get there.
On AROS the build is failed, the log is also on the download page, if someone can tell me what is the problem, don't hesitate.
The quantizer eats up a lot of memory (around 7-800k), so on the Amiga, at least 2 MB RAM is recommended. With 2 MB of Chip RAM, there should be no problem about converting 320x200@24 pictures. (My A500+ managed to convert them during the tests, with only 2 MB of Chip RAM.)
If there are plenty of RAM (cca. 16 MB), then even HD pictures can be converted on the Amiga. (Well...slow water washes the coast, a HD picture can take much hours for a pure 68000.)

The binaries are standalone, they don't need external libraries on any platform, with the exception of the pure 68000 and 68020 Amiga versions which are needs mathieee*.libraries for floating point calculations. The 68020+68881 version don't needs FP libraries, but naturally it needs an FPU.

Well, have fun and don't forget to report bugs. :P
The binaries contains the detailed manual about everything, but if there are questions, then ask them.
jsr is offline  
AdSense AdSense  
Page generated in 0.07540 seconds with 9 queries