diff --git a/tools/imagecon/README.md b/tools/imagecon/README.md index 14927e7..d81d56f 100644 --- a/tools/imagecon/README.md +++ b/tools/imagecon/README.md @@ -17,6 +17,7 @@ usage --output-bitplanes --output-mask --output-copperlist + --output-png --extra-half-brite --ham --ham-brute-force @@ -33,6 +34,7 @@ The following files can be generated: 4. **<output prefix>-palette.s** m68k assembler syntax code to install the color palette (preserves all registers) 5. **<output prefix>.pal** palette file listing the palette colors as hex 6. **<output prefix>-mask.bin** binary interleaved bitplane mask +7. **<output prefix>-converted.png** paletted PNG version of converted file options ------- @@ -76,6 +78,11 @@ Generate m68k assembler instructions to install the palette. No symbols are gene Generate m68k assembler instructions to install a greyscale version of the palette. No symbols are generated. Registers are preserved. +**--output-png** + +Generate a paletted PNG file based on the final converted data. + + **--extra-half-brite** Generate an extra half brite image. This only works in combination with --colors 32. A 32 color palette will be output, however there will be a sixth bitplane that includes the half brite control bits for any pixels that can use it. diff --git a/tools/imagecon/imagecon.c b/tools/imagecon/imagecon.c index 43febae..9df760f 100644 --- a/tools/imagecon/imagecon.c +++ b/tools/imagecon/imagecon.c @@ -353,7 +353,7 @@ generateEHBImage(imagecon_image_t* ic) static void -processFile(char* outFilename, imagecon_image_t* ic) +processFile(imagecon_image_t* ic, char* outFilename) { if (config.verbose) { printf("processFile...\n"); @@ -555,7 +555,7 @@ main(int argc, char **argv) if (strchr(inputFile, ',') == 0) { imagecon_image_t ic = {0}; png_read(&ic, inputFile); - processFile(outputFile, &ic); + processFile(&ic, outputFile); } else { char** files; int numFiles; @@ -570,7 +570,7 @@ main(int argc, char **argv) imagecon_image_t combined; combineImages(images, numFiles, &combined); - processFile(outputFile, &combined); + processFile(&combined, outputFile); } return 0; diff --git a/tools/imagecon/imagecon.h b/tools/imagecon/imagecon.h index 96c8703..d4d0e61 100644 --- a/tools/imagecon/imagecon.h +++ b/tools/imagecon/imagecon.h @@ -77,17 +77,12 @@ typedef struct { #include "palette.h" #include "quant.h" #include "utils.h" +#include "png.h" extern imagecon_config_t config; extern void abort_(const char * s, ...); -extern void -png_read(imagecon_image_t* ic, char* file_name); - -extern void -png_write(imagecon_image_t* ic, char* file_name); - void generateQuantizedImage(imagecon_image_t* ic, int usePalette);