PNGconv - converting "PC formats" to Atari (and more)

WinSTon, Nostalgia, MSA Converter, FloImg, Makedisk and all the others.

Moderators: Mug UK, Moderator Team

User avatar
troed
Atari God
Atari God
Posts: 1214
Joined: Mon Apr 30, 2012 6:20 pm
Location: Sweden

PNGconv - converting "PC formats" to Atari (and more)

Postby troed » Sat Aug 22, 2015 10:30 pm

Hi all,

A week ago I pushed some source code to Github and wrote a Google+ post on having made a converter from PNG/GIF etc to native Atari ST formats. I made some fun out of having spent some time on a tool I would most certainly be the only user of as well.

Thanks to Nicolas Pomarède, who let me know that there were others interested and made a few suggestions, I've now added some further functionality and made a proper v1.0 release.

What it is? Well, it converts from modern graphics format to Atari ST, and it's really meant for coders who sometimes want special formats. (Want a 1096*32 .PNG with a font converted into a 1096*32 .PI1-style bitmap? Sure). It does produce regular Degas compatible .PIx files as well however, if you take care to match size and resolution.

Example uses:

Degas low resolution compatible:

Code: Select all

java -jar PNGconv.jar input.png output.pi1 low -header


Minimal possible bitplane mask that still contains all colors and with planes saved consecutively (Amiga style):

Code: Select all

java -jar PNGconv.jar input.png output.bin -fit -ACBM


Medium resolution bitmap with STE palette, no header and background color forced to black.

Code: Select all

java -jar PNGconv.jar input.png output.pic medium -4096STE -bgcol 000


What it isn't: A prettifier. This is not the tool to dither high color pictures into ST palette limitations, flicker screens between chroma/luma pairs etc.

Full README below:

Code: Select all

PNGconv - a "whatever Java can load, so not only PNG,
             to various image formats, so not only Atari ST,
             converter"

Input:   .png, .gif, .jpg, .bmp, ...
Output:  .pi1-compatible (ST low resolution)
         .pi2-compatible (ST medium resolution)
         .pi3-compatible (ST high resolution - untested)
         chunky (one word per pixel, 0x000-0x777/0xfff ST/STE/Amiga color range)
         .png (reduced to 3 or 4 color bitdepth)
         ... and more

Usage:

java -jar PNGconv.jar <input filename> <output filename> [mode] [-option1] [-option2] [-option...]

mode = "reduce"  - Converts input image from 8 bit per color channel to 3 or 4, outputs in .PNG
     = "chunky"  - Converts input image from 8 bit per color channel to 3 or 4, outputs binary
                   with one word per pixel: 0x000-0x777 or 0x000-0xfff.
     = "high"    - Converts input image to ST high resolution
     = "medium"  - Converts input image to ST medium resolution
     = "low"     - Converts input image to ST low resolution

options:

-fit         = Calculates number of bitplanes needed for palette in input and uses only those. Might be 3, 5 etc!
-ACBM        = Outputs Amiga continuous bitplane format, one full image bitplane after another
-ILBM        = Outputs Amiga interleaved bitplane format, one image row of bitplane after another
-header      = Adds header with palette to output (in 1,2 and 4 bitplane modes the header will be Atari Degas compatible)
-512         = Use ST color depth (3 bits per color channel, default)
-4096        = Use Amiga color depth (4 bits per color channel, bit order 4321)
-4096STE     = Use STE color depth (4 bits per color channel, bit order 1432)
-bgcol xyz   = Force first palette entry (background color) to be "xyz" (in target bit depth hexadecimal, 000 = black)

If used in bitplane mode the program will output the number of unique colors found
(used for building the palette). No translation between image sizes or palette sizes is made
- input image should be valid for the intended output use case.

Written by Troed of SYNC

Licensed under Creative Commons Zero


... and here's where you find it.

Project page: https://github.com/troed/PNGconv

.JAR download link: https://github.com/troed/PNGconv/releas ... NGconv.jar

Enjoy.

(Oh, and yes. It's open source. I'd prefer if suggestions are made via pull requests ;))

/Troed

User avatar
npomarede
Atari God
Atari God
Posts: 1178
Joined: Sat Dec 01, 2007 7:38 pm
Location: France

Re: PNGconv - converting "PC formats" to Atari (and more)

Postby npomarede » Sat Aug 22, 2015 10:40 pm

A very useful tool that saved me some time by not having to write a similar one :)

Having a quick and portable program that works on all OSes is really nice to have in your toolchain when you want to use modern OS / text editor / graphics program and assemble the resulting file with vasm for example.

Thanks to Troed :)

Nicolas

User avatar
npomarede
Atari God
Atari God
Posts: 1178
Joined: Sat Dec 01, 2007 7:38 pm
Location: France

Re: PNGconv - converting "PC formats" to Atari (and more)

Postby npomarede » Mon Aug 24, 2015 4:12 pm

npomarede wrote:A very useful tool that saved me some time by not having to write a similar one :)

Having a quick and portable program that works on all OSes is really nice to have in your toolchain when you want to use modern OS / text editor / graphics program and assemble the resulting file with vasm for example.


Made another test by converting a png font of 960x16 consisting of 60 16x16 chars in 1 bitplane and the result can be directly incbin'ed into devpac, really handy !


Social Media

     

Return to “Other emulators & tools”

Who is online

Users browsing this forum: No registered users and 1 guest