ppmtofli(1) C64Gfx ppmtofli(1) NAME ppmtofli - convert a portable pixmap file to a C64 FLI picture file SYNOPSIS ppmtofli [-vmbswd -l] [ []] DESCRIPTION Reads a portable pixmap file and produces an C64 FLI picture file. Due to the limitations in fli picture format and C64 graphics capabilities, ppmtofli cannot always do a one-to-one translation between the images. When you draw a picture, you should use the palette distributed in this package. However, it is not absolutely necessary. Ppmtofli will always do its best to select the most suitable color, but the selection may be other than you wanted. First ppmtofli will select the colors for the color memory. It will pick the most used color in the corresponding character position. Here only those four-pixel groups that use more than two colors are counted. Then the conversion begins and the program will use the FLI colors if needed. If it runs out of possible color, if will take the best approximation, but does not normally reorder or merge the colors already in use. OPTIONS d = do a simple dithering in the color conversion l = set the importance of the luminance value of the color (default 7) w = use the 12 leftmost pixels too (will use approximation) s = shift the picture before converting b = use the background colors in the conversion m = merge FLI colors if it means less errors v = verbose, output extra information about the process Options can be anywhere in the command line and they can grouped or given separately. Filenames are optional. example: ppmtofli -w magic.ppm -mb magic.fli -d15 If you have a picture with colors that do not match C64 palette in large areas, you can try the simple dither option, -d followed by a number. In this mode ppmtofli will propagate half of the color error to the next cell in that line and the other half to the cell in the next line. The color error is the difference between the picked color and the wanted color and before propagating the error, the value will be divided with the dither value given in the command line. Sometimes a dither value around 2 is better than none, sometimes the other way around and sometimes -d1 is optimal. The only way to know for sure is to try several dither divider values until you get the best result. If you use the dither option, it must be the last option in that argument. example: ppmtofli -d2 heaven.ppm heaven.fli Generally it seems that the dither value 1 gives the best results, but for drawn pictures no dithering suits better. The luminance inportance also has a great impact on the results. With bright pictures you get 'really' good results if you increase the luminance importance. However, if you want 'realistic' colors, use the default setting (7) or less. There is a little 'feature' in the FLI mode: the three leftmost character positions always show bit pairs 11 as brown and pairs 01 and 10 as light gray. Because of this, ppmtofli will not normally convert the leftmost 12 pixels at all, leaving them black. With option -w you can enable the use of that area too and the program will do it's best to convert any colors in this area to the previously mentioned colors. You can move the picture 12 pixels to the right with the -s option. It is not wise to use the -w option then. However, it will cause just a bit slower conversion. Of course there are cases when you need three different colors in one four-pixel group, but the color memory color is not one of them. Approximating the color is not always the best solution. With the merge option (-m) you can enable the merging of the FLI colors, if they are closer to each other than the overflowing color is to any of the colors available. Currently the merge is not very optimal, it does not know about all the merge possibilities. example: FLI colors are 0x0d and 0x03 and we want to plot 0x09. Converter will merge 0x0d and 0x03 and put 0x09 to the other fli color. If you want that the converter will use the background colors in the conversion too, use the -b option. In this mode ppmtofli will first select the colors for the color memory and then background colors for each scan line. This will free more FLI-colors and the conversion may be perfect. You must take into account that it might be impossible to do any further edits to the picture, because FLI editors in C64 will handle the background color edits independently from the other colors, and on almost all cases the approximation and merge will lead to much better pictures. In fact, this option/mode is quite useless, but you could take advantage of it when designing color bars. Some fli viewers also don't even show the background colors. SEE ALSO FLI.doc ppmtokoala, koalatoppm, ppmtobfli, c64toppm, c64toilbm, ppmtofli, flitoppm, ppmtoffli, fflitoppm AUTHOR Copyright © 1991-95 by Pasi 'Albert' Ojala. Permission to use, copy and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. This software is provided "as is" without express or implied warranty. I still retain rights to the sources and changed source code may not be distributed in any form. However, you are allowed to use the ideas and methods found from the source codes.