Graphic/Picture File Formats on VIC-20

Basic and Machine Language

Moderator: Moderators

User avatar
hawk
Vic 20 Afficionado
Posts: 342
Joined: Mon Jun 20, 2005 7:32 pm

Graphic/Picture File Formats on VIC-20

Post by hawk »

Are there any "standard" picture file formats which have been adopted for the VIC-20 like there have for the C64?

I was considering the possibility of cross development tools which could make the creation of images for the VIC-20 easier. Tools like I'm thinking of exist for the C64 and Atari 8-bits. They can even handle the "active" picture formats, which for the VIC, interlacing would be one.
a1bert
Vic 20 Dabbler
Posts: 96
Joined: Mon Jan 23, 2006 12:49 am

Re: Graphic/Picture File Formats on VIC-20

Post by a1bert »

hawk wrote:Are there any "standard" picture file formats which have been adopted for the VIC-20
I don't think so, unless there is one for the SuperExpander ?
hawk wrote:They can even handle the "active" picture formats, which for the VIC, interlacing would be one.
The NTSC VIC-I actually has an interlace mode.

However, using it, or using the "swap screen" method is not practical for general-purpose picture viewers simply because the VIC-I has a very view of the RAM. It can only see 5kB or RAM.

Talking about pictures, have you read what's on http://www.iki.fi/a1bert/Dev/vicgfx/ ?

-Pasi
User avatar
hawk
Vic 20 Afficionado
Posts: 342
Joined: Mon Jun 20, 2005 7:32 pm

Post by hawk »

Thanks for that Pasi. Yes I had seen your page a while ago, but I'd forgotten about it. I'll have to have a play and see how it works.

I was also looking at Aleksi's Picasso program, however it runs on the VIC-20. I was imagining being able to manipulate an image in Windows, and then convert it onto the VIC as your program does. I guess the difference would be having a preview of how it would appear on the VIC.
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

The victoppm is rather useful to get an idea what the result will look like. It would be even better with victogif or similar, but I'm afraid GIF and most other graphic formats are a bit difficult to manually encode. Perhaps if it is linked with the GD package or some other library. By the way, my page of pictures converted with ppmtovic still is offline. I should fix that some day.

Of course, if you like some GUI hacking, it might be possible to integrate both ppmtovic and victo-* into one tool.
Anders Carlsson

Image Image Image Image Image
User avatar
hawk
Vic 20 Afficionado
Posts: 342
Joined: Mon Jun 20, 2005 7:32 pm

Post by hawk »

It's funny Anders, but Pasi has a link to your pictures on his site, and I was looking forward to seeing them... :cry: :wink: As much as the Babylon 5 pictures are good, I was hoping to find some pictures that were converted from something less realistic to see what the results are like.

I had had already thought about what you proposed. If they can take input from stdin, and output to stdout, then it should be possible to pipe one into the other, and just check the output.

I had a bit of a play with the conversion tool last night, but wasn't successful. The graphics program I chose was outputting the PPM file as type P5, and the converter was expecting P6. I'll have to do some more investigating.
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

Yes. The embarrassing part is that my "new" web page has been under construction for three (?!) years, while at the same time I churn out portals, communities, CMS systems and whatsnot in the world of web programming as my daily job.

http://www.cbm.sfks.se/ppm2vic/
Anders Carlsson

Image Image Image Image Image
User avatar
hawk
Vic 20 Afficionado
Posts: 342
Joined: Mon Jun 20, 2005 7:32 pm

Post by hawk »

Thanks for putting the pictures up Carlsson. It gives me a better idea of what to expect using that tool, especially since you have the command line setting there also.
User avatar
ral-clan
plays wooden flutes
Posts: 3702
Joined: Thu Jan 26, 2006 2:01 pm
Location: Canada

Post by ral-clan »

Do any of these graphic display programs have the option for black & white (i.e. white or black pixel) dithered images? The coloured dither images on the web-site are nice, but B&W dithered images would not use the double pixel widths of the VIC's multi-colour hi-res mode.
a1bert
Vic 20 Dabbler
Posts: 96
Joined: Mon Jan 23, 2006 12:49 am

Post by a1bert »

ral-clan wrote:Do any of these graphic display programs have the option for black & white
Not currently, but I will take a look if ppmtovic/victoppm could be easily extended. But "hires" does not need to be black and white. We'll see how well it works.

-Pasi
a1bert
Vic 20 Dabbler
Posts: 96
Joined: Mon Jan 23, 2006 12:49 am

Post by a1bert »

a1bert wrote:I will take a look if ppmtovic/victoppm could be easily extended. But "hires" does not need to be black and white.
Yes, it was quite simple to make a hires mode, but it only uses black and white for now. Specify -H in ppmtovic, the new victoppm detects hires/multicolor, and the viewer program(s) needed no change at all.

http://www.iki.fi/a1bert/Dev/vicgfx/

It could be improved to use more than two colors, but the way ppmvic works does not work as well with just one line-by-line background color and one cell-by-cell color. The largest problem is that ppmtovic first dithers the original ppm into the colors given to it, and in the next phase the line and color cell colors are selected.

I think the multicolor version is a clear winner.

It would be possible to have a hybrid version (cell-by-cell selection of hires/multicolo), but coding that would be a nightmare..

-Pasi
User avatar
ral-clan
plays wooden flutes
Posts: 3702
Joined: Thu Jan 26, 2006 2:01 pm
Location: Canada

Post by ral-clan »

I do like the new black and white dithered render. There are certain advantages to this mode (sharper for one). Also, since the colours of the VIC are so widely spaced, often the colour renders do not actually actually have any relevance to the colours of the original image.

Would it be possible to do the above using red and purple and white? Red and purple are fairly close together, and would allow a little bid of shading.

Another extension of the program that would be useful: by turning the colour down on one's monitor so that it only shows the VIC colours as shades of grey - use these grey shades to render greyscale images.
User avatar
hawk
Vic 20 Afficionado
Posts: 342
Joined: Mon Jun 20, 2005 7:32 pm

Post by hawk »

The new B&W mode does look sharper. The other advantage of it is that, theoretically, you should be able to do all the processing of the image in a paint program, and then perform the conversion, and know exactly what your going to get.

Ral-clan, I've had the same idea regarding the shading, however, I wasn't thinking grey. I've looked at a few demos, and they're able to get quite good shading with black, white and two shades of blue. Again, a paint program could be used to edit the grey scale image, then each of the greys mapped to a VIC colour.

I'm still searching for an editor that can handle 'P6' type binary PPM images so I can play with the converter.
a1bert
Vic 20 Dabbler
Posts: 96
Joined: Mon Jan 23, 2006 12:49 am

Post by a1bert »

ral-clan wrote:often the colour renders do not actually actually have any relevance to the colours of the original image. [..] would be useful: by turning the colour down on one's monitor so that it only shows the VIC colours as shades of grey
You already have this when you raise the luminance importance (for example -l20). In most cases the result is better when you give up the relevance to the colors of the original picture.
ral-clan wrote:Would it be possible to do the above using red and purple and white?
Three colors is very problematic because each color cell can have only the cell color and a common background color for that scanline. In VIC-II each cell can have its own background and foreground colors, so only those are affected by the pixels in that 8x8 area. But in vicgfx the pixels of the "other color" can affect the whole raster line.

-Pasi
User avatar
hawk
Vic 20 Afficionado
Posts: 342
Joined: Mon Jun 20, 2005 7:32 pm

Post by hawk »

I finally found an image editor that handles Binary PPM files, so I've been having a play with the new version of 'ppmtovic'. I've mostly been experimenting with Greyscale images. I've been learning a lot about how to get the most out of it, and have been happy with the results. I can't show you anything at the moment, as I have nowhere to upload te files to. I'll try and get that sorted real soon.

I had to make a minor modification to the program to enable it to handle comments within the header block which seem to be in the specification for both ASCII and Binary Pixmap formats.

I also have a suggestion regarding a new mode...Monochrome mode, where the program simply takes a PBM file (Monochrome Pixmap) and converts it into a VIC image. This would enable full processing of the image to be done by a paint program. The only difference between the PBM file and the VIC program would be the aspect ratio.

I've had all sorts of fun manipulating the starting image before conversion to ensure that I get the aspect ratio correct at the size the VIC can handle.

Anyway, thanks for the program Pasi, it's cool.
User avatar
hawk
Vic 20 Afficionado
Posts: 342
Joined: Mon Jun 20, 2005 7:32 pm

Post by hawk »

I finally setup some storage space.

Below are some samples I've played with. Each one shows the input file (distorted for the transition) and a screen capture from Vice. They are all in High Resolution mode (200x160), require minimum 8k expansion, and are built for PAL.

This was my first real success at getting the aspect ratio correct. It still needs some adjustment of the contrast.
http://www.users.on.net/~hawkeys//mike/ ... yes_8k.prg
Image
http://www.users.on.net/~hawkeys/mike/r ... yes_8k.prg
Image

Testing a picture with more grey shades. The original image was resampled instead of resized to get it to the correct size, resulting in some artifacts in the original.
Image
http://www.users.on.net/~hawkeys/mike/r ... sc2_8k.prg
Image

This was to see how having more detail in the picture effected the quality. How fine can the detail be and still recognise the image. I think it came out OK.
Image
http://www.users.on.net/~hawkeys/mike/r ... sc3_8k.prg
Image

This is the same as above but with the contrast increased using ppmtovic by 25%. I think this result is better. You can see that the areas that should be black are black, and not diffused.
http://www.users.on.net/~hawkeys/mike/r ... sc4_8k.prg
Image

Anyway hope you like my samples. Pasi, I'll setup a web page to put all the pictures on so you can link to it from your ppmtovic page if you like.
Last edited by hawk on Mon Jun 03, 2013 3:05 am, edited 2 times in total.
Post Reply