Graphic/Picture File Formats on VIC-20

Basic and Machine Language

Moderator: Moderators

carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

Maybe I misremember things. :-D Or that the victoppm program once written by yours truly outputs an ASCII file.
Anders Carlsson

Image Image Image Image Image
traymond
Vic 20 Newbie
Posts: 3
Joined: Thu Nov 10, 2005 4:38 am

Post by traymond »

hawk wrote: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.

Hi Hawk where did you get the Image editor? I have looked all over the place on the Internet even a lot of the Adobe Picture editors and none will convert to 160X100 and drop down to 16 colors.
Will a lot of other Image editors like X-inview do this?

Im in the U.S. and using a NTSC Vic. How can I get the "assembled" version of Pasi's Graphic editor, I see that is in C code but I have no access nor the skills to assemble this into runnable code. :( and will Pasi's editor work in either PAL (or) NTSC Vic-20's?

Im thinking Pasi's editor was only for Pal :( So I will have to find a PC graphics editor that will support 160X100 and 16 colors, the software I fo und would not go down to 160, only larger images.

Seems the Adobe Photo Shop image software is "very very" expensive and I loathe demo software that works for a limited time.

I noticed in Congo- PC Commodore image converter that it supports Photo Shop plug-ins, does anybody know where I could find the right plug ins that would support: image sizes down to 160 X 100 and 16 colors?

Seems anymore its all in Millions of colors and they do not support 16 colors and the smaller images. :(

So I really dont know how to find the right Image converter.


Also I know Godot will support basic .GIF color pics, you could use Congo to knock the image down to 320X200 and Zoom into the image more and tinker with the colors, then use a PC image program to convert to 160X100 and then 16 colors (well I guess Congo will convert to 16 colors)?
So the Vic if I remember right does not work with "bitmap" but only
hires and Multicolor? (have been away from the vic for a long time).

Any suggestions,
Last edited by traymond on Sun Mar 29, 2009 3:51 pm, edited 1 time in total.
-Terry Raymond
traymond
Vic 20 Newbie
Posts: 3
Joined: Thu Nov 10, 2005 4:38 am

Post by traymond »

a1bert wrote:
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
Hi Pasi your converter seems like a neat converter, but I have no skills in programming and no way to make this converter code a runnable application, cant you somehow make this available to all fully assembled?

And is this only in PAL format, can you convert this to NTSC too?

Other than that this is a really cool converter.

Is there anyway from basic to load the Image for a short time and then exit the viewer?

If I cannot get this hires converter, what other PC conversion programs will convert to the 200X100 resolution and 16 colors, or even B&W.

Also there is Congo and that works with Plug-ins, do you know of any plugins that will support the above questions?

I assume then the final image you want to display on the Vic the file extension of the image should be: IMAGE.PPM is this correct?

I noticed in the Vimmi files there are .jpg images and if I remember correctly: .VIC I think I cant remember.


I need a way I can handle the loading of the Image from basic and only 5k Ram but return the control back to basic to do other tasks, not stay in the display program.
-Terry Raymond
User avatar
Mike
Herr VC
Posts: 4841
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

Hi, Terry,

I use IrfanView, and a small collection of C programs, to convert images for use by MINIGRAFIK.

You might take a look at VICtoria Gold Edition.
I need a way I can handle the loading of the Image from basic and only 5k Ram but return the control back to basic to do other tasks, not stay in the display program.
Is using an unexpanded VIC a strict requirement? A full size bitmap occupies the ENTIRE space available for BASIC programs between $1000 and $1FFF. You'd need to place some tandem ML program in the lower 1K to load, and start a new program.

Pasi's bitmaps also need the bottom 1K, so one can't do much better than completely reset the VIC.

If you allow for at least an 8K memory expansion, your BASIC program can reside in BLK1 upwards, load the bitmap, display it, and continue without big problems ...

Greetings,

Michael

P.S.: Welcome to Denial. :)
Last edited by Mike on Mon Mar 30, 2009 4:01 am, edited 1 time in total.
User avatar
hawk
Vic 20 Afficionado
Posts: 342
Joined: Mon Jun 20, 2005 7:32 pm

Post by hawk »

traymond wrote:Hi Hawk where did you get the Image editor? I have looked all over the place on the Internet even a lot of the Adobe Picture editors and none will convert to 160X100 and drop down to 16 colors.
Will a lot of other Image editors like X-inview do this?
Hi Terry,

I can't remember what I was using at the time I wrote that, but I just checked, and The Gimp handles PPM, allowing output in Raw or Binary. It will also handle indexed/palette based images down to as few colours as you like. Create a palette that matches the Vic and see how you go. From memory, I had difficulties in the early days, as the then version of ppm2vic didn't handle comments that some graphics programs put in the header block. But I believe that it's all fixed now.
traymond wrote:Im in the U.S. and using a NTSC Vic. How can I get the "assembled" version of Pasi's Graphic editor, I see that is in C code but I have no access nor the skills to assemble this into runnable code. :( and will Pasi's editor work in either PAL (or) NTSC Vic-20's?
A version of ppm2vic compile for PCs can be found here.

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

It will output either NTSC or PAL, depending on command line settings.
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

Oh, look. That is my web page. :oops: I've been in contact with Terry by e-mail before he joined the forum, but I forgot to mention that I had an executable version posted on my own web page. :lol:

However I'm not sure if it reflects the very latest version, but it'll be easy to remedy if not. I'm using the MinGW + MSys compiler environment, which produces Win32 executables but not runnable in pure DOS. Not that people would need it in this day anyhow.

But yes, in order to make a slideshow for unexpanded VIC, you would pretty much need to rip the VIMMII code and replace the pictures. It was a very tight fit even if you would omit the music. Adding 3K or ideally 8K expansion will make things much easier, although the target audience decreases somewhat; those who happen to own a VIC-20 but not really use it more than booting up a game once a year. Most of that bunch will not have any memory expansions to work with, unlike those of us regulars on Denial (I think even Jeff-20 owns a 8K or 16K expansion even though he may not be too eager to use it).
Anders Carlsson

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

Post by a1bert »

traymond wrote:So I will have to find a PC graphics editor that will support 160X100 and 16 colors, the software I found would not go down to 160, only larger images.
If you get yourself the ppmtools package (I assume it must be available for windows too), you can use any graphics editor and save to most formats, and can then convert to ppm and scale and/or crop the picture from the commandline, then feed to ppmtovic.

Also, you don't need to drop the colors to 16 beforehand. You can leave ppmtovic do that, and you can select which vic20 colors will be available. This allows mid-shades and colors to be created using dithering.
So the Vic if I remember right does not work with "bitmap" but only hires and Multicolor?
It's only hires or multicolor character mode with user-definable characters. The characters can be in 16-line mode, so that the video matrix can be a little smaller.
a1bert
Vic 20 Dabbler
Posts: 96
Joined: Mon Jan 23, 2006 12:49 am

Post by a1bert »

traymond wrote:And is this only in PAL format, can you convert this to NTSC too?
The converter always produces the same image size and does not care about the video system. PAL/NTSC depends on the viewer routine.
Is there anyway from basic to load the Image for a short time and then exit the viewer?
To run and switch pictures on the unexpanded machine almost all of the memory is used, including low memory. BASIC space is completely used by the graphics.
I assume then the final image you want to display on the Vic the file extension of the image should be: IMAGE.PPM is this correct?
I noticed in the Vimmi files there are .jpg images and if I remember correctly: .VIC
VIMMII source package have some original pictures in .jpg and .gif, and these are first converted to .ppm and scaled and cropped to the 100x160 resolution. Then ppmtovic converts them into binary, and the color memory and graphics memory datas are then separated into two files, so that the viewer program can load them directly into memory.
I need a way I can handle the loading of the Image from basic and only 5k Ram but return the control back to basic to do other tasks, not stay in the display program.
The slideshow viewer could show all pictures and then load the next program, but at this resolution there is no space for a program that would stay in memory during the picture display.

I could make a slideshow routine from the vimmii sources. The code already loads as many pictures as it can find before loading the next part, so it is easy to replace and add pictures.
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

As I mentioned before, IrfanView is a very good and cost-free tool to both convert, crop and resize images between "foreign" formats including PPM.

Based on what Terry has told me, I understand why he aims for a picture viewer on the unexpanded VIC; basically maximize the audience. Perhaps a modified version of the program is in order, one that outputs a 80x160 image (3200 bytes + colour data) or even 80x128 (2560 bytes). It ain't quite as big screen cool as 100x160 but would well fit into an unexpanded VIC-20 with some viewer code to go.
Anders Carlsson

Image Image Image Image Image
Post Reply