Graphic/Picture File Formats on VIC-20
Moderator: Moderators
I'm still playing around with these ideas, but I've had some problems with the latest build of ppmtovic. Processing the same image files with the same settings results in some corruption of the output image.
Also, if I specify only to use certain colours, it stll uses some others (only black I think). I haven't had a chance to nail down the problems yet, but in the meantime, check this out...
http://www.ticalc.org/pub/win/graphics/
Have a look at the files
http://www.ticalc.org/pub/win/graphics/istudio.zip
http://www.ticalc.org/pub/win/graphics/istudio2.zip
Although it's only working in greyscale, and the final output isn't in the correct format, it gives some good ideas about what can be achieved.
At the same site there are also some good character/font editors that do output in a format useable for the VIC.
Also, if I specify only to use certain colours, it stll uses some others (only black I think). I haven't had a chance to nail down the problems yet, but in the meantime, check this out...
http://www.ticalc.org/pub/win/graphics/
Have a look at the files
http://www.ticalc.org/pub/win/graphics/istudio.zip
http://www.ticalc.org/pub/win/graphics/istudio2.zip
Although it's only working in greyscale, and the final output isn't in the correct format, it gives some good ideas about what can be achieved.
At the same site there are also some good character/font editors that do output in a format useable for the VIC.
Just posting a followup to this thread.
As it turned out, the corruption I was getting was being caused by me using an interim version of the program. When I grabbed the latest, it fixed my problems.
Pasi, do you have the source for the assembler versions of the display code that gets added to the output file? If so, is it possible to grab a copy? I'm looking through it to see how it works. I'm also considering a program which loads the image programs and displays them via windows with the possibility of extending it to include editing.
Thanks,
Hawk.
As it turned out, the corruption I was getting was being caused by me using an interim version of the program. When I grabbed the latest, it fixed my problems.
Pasi, do you have the source for the assembler versions of the display code that gets added to the output file? If so, is it possible to grab a copy? I'm looking through it to see how it works. I'm also considering a program which loads the image programs and displays them via windows with the possibility of extending it to include editing.
Thanks,
Hawk.
There are several versions with slightly differing specs in the VIMM and VIMMII source code packages, and I just uploaded the version used by the ppmtovic to http://www.iki.fi/a1bert/Dev/vicgfx/fullpic.asm (but there is no link to it in the Vicgfx page).hawk wrote:Pasi, do you have the source for the assembler versions of the display code that gets added to the output file?
The VIC20 viewer "simply" changes all of the three multicolor colors each rasterline, and switches video matrix every 8 lines to switch the color memory to get 8x8-pixel (well, 4x8 in multicolor) color memory resolution with 16-line characters.hawk wrote:I'm looking through it to see how it works. I'm also considering a program which loads the image programs and displays them via windows with the possibility of extending it to include editing.
If you want to make a display program, check the newest version of victoppm.c. It already handles both multicolor and hires, and also mixed-mode pictures. There is not yet a program to generate those but the format now allows it.
-Pasi
Pasi, I've made a small change to ppmtovic to assist with my lastest experiments.
It now allows some or all of the colours to be initialised, using the -i option, rather than always initialising all the colours.
This allowed me to specify a bacground colour which would always be honoured, and still have the program work out the forground colours.
Would you like to roll this change into the baseline program?
--Hawk
Edit
PS. I tried to get the latest version of victoppm.c, but it appears to be the same as the old version, ie. doesn't handle all the new modes.
Thanks.
It now allows some or all of the colours to be initialised, using the -i option, rather than always initialising all the colours.
Code: Select all
ie. -i///1 (white background)
Code: Select all
case 'i':
x++;
if (argv[i][x]!='/')
c0 = (atoi(argv[i]+x) /*& 15*/);
while(argv[i][x]>='0' && argv[i][x]<='9')
x++;
if(argv[i][x]=='/') {
x++;
if (argv[i][x]!='/')
c1 = (atoi(argv[i]+x) /*& 15*/);
while(argv[i][x]>='0' && argv[i][x]<='9')
x++;
if(argv[i][x]=='/') {
x++;
if (argv[i][x]!='/')
c2 = (atoi(argv[i]+x) /*& 15*/);
while(argv[i][x]>='0' && argv[i][x]<='9')
x++;
if(argv[i][x]=='/') {
x++;
if (argv[i][x]>='0' && argv[i][x]<='9')
c3 = (atoi(argv[i]+x) /*& 15*/);
while(argv[i][x]>='0' && argv[i][x]<='9')
x++;
}
}
}
x--;
break;
--Hawk
Edit
PS. I tried to get the latest version of victoppm.c, but it appears to be the same as the old version, ie. doesn't handle all the new modes.
Thanks.
Well, you could've used 255 for not used..hawk wrote:It now allows some or all of the colours to be initialised, using the -i option, rather than always initialising all the colours.
Strange. When I convert files with ppmtovic, victoppm can convert them back correctly, whether I run ppmtovic with or without -H.hawk wrote: PS. I tried to get the latest version of victoppm.c, but it appears to be the same as the old version, ie. doesn't handle all the new modes.
But, victoppm assumes a file without the viewer, so that may be your problem?
-Pasi
Oops...I hadn't picked up the subtleties of that.a1bert wrote:Well, you could've used 255 for not used..
I hadn't realised that it was converting the file without the viewer, but from looking at the code (on you web page) it appears to only handle 100x160.a1bert wrote:Strange. When I convert files with ppmtovic, victoppm can convert them back correctly, whether I run ppmtovic with or without -H.
But, victoppm assumes a file without the viewer, so that may be your problem?
I'm attempting to write a windows program that will read in, identify, and display the file appropriately.
--Hawk
Victoppm handles "100x160" multicolor, but it actually outputs 300x160 to the ppm file to approximate the VIC-I pixel aspect ratio. Thus, multicolor pixels become 3x1 square pixels, and hires pixels become either 2x1 or 1x1 (1.5x1 on average) square pixels. The decision is done on a color-cell basis, thus you can mix multicolor and hires cells in the data file and the output looks correct.hawk wrote:from looking at the code (on you web page) it appears to only handle 100x160.
But, as I said, victoppm doesn't try to detect files with viewer code attached, and that should be improved.
-Pasi
Can anyone compile a version of "ppmtovic" to run on an Intel Windows machine or Amiga for me? The C source code is on A1bert's site:
http://www.cs.tut.fi/~albert/Dev/vicgfx/
...but I don't have anyway to compile it into an executable.
I want to be able to run it from a command line in Windows (or on an Amiga).
Thanks!
http://www.cs.tut.fi/~albert/Dev/vicgfx/
...but I don't have anyway to compile it into an executable.
I want to be able to run it from a command line in Windows (or on an Amiga).
Thanks!
I uploaded some Windows binaries to my page:
http://www.cbm.sfks.se/ppm2vic/
Please remember you need to convert your source file to ASCII PPM format. It also helps a lot if you resize and crop the image before conversion. Preferrably you should shrink the source picture so it is 1/3 as wide as it is tall, i.e. corrupted dimensions. As the VIC will display every pixel at triple width (like Albert wrote above), the dimension ratio gets restored that way.
If you have difficulties and don't want to discuss them in public, you're free to ask me - I've already been informed about your business.
http://www.cbm.sfks.se/ppm2vic/
Please remember you need to convert your source file to ASCII PPM format. It also helps a lot if you resize and crop the image before conversion. Preferrably you should shrink the source picture so it is 1/3 as wide as it is tall, i.e. corrupted dimensions. As the VIC will display every pixel at triple width (like Albert wrote above), the dimension ratio gets restored that way.
If you have difficulties and don't want to discuss them in public, you're free to ask me - I've already been informed about your business.
Anders Carlsson
Interesting. When I save a PPM as an ASCII PPM in Irfanview, PPMTOVIC says it can't handle that file type. But when I save it as a Binary PPM with Irfanview, it processes it just fine.carlsson wrote:Please remember you need to convert your source file to ASCII PPM format....From the good old days of xv and Solaris, I remember the portable pixmap format (PPM) was available in two versions: one ASCII version where each RGB pixel was specified as three decimal values, and one binary version where each pixel value was stored as three bytes.
If you look though the source, you'll see that ppmtovic only handles the P6 format of the PPM file, which uses binary encoding. The header is still ASCII, but the image data is binary.ral-clan wrote:Interesting. When I save a PPM as an ASCII PPM in Irfanview, PPMTOVIC says it can't handle that file type. But when I save it as a Binary PPM with Irfanview, it processes it just fine.