Jump to content
IGNORED

Quantizator


ilmenit

Recommended Posts

I'm not being arsey with you it's just when two of us have written code specifically to do this so that it's easier to add the mid scanline, pmg and any other stuff then you post images that aren't in A8 palette, then are but double the colours or have the source colours reduced by changing brightness it's hard to compare which code has the best quantization method. So far the pnmquant LN looks the best but to be honest I prefer my Exile and Dune, but based on the pnmquant LN one I'm going to include median cut algorithm in my code as my LN still doesn't look as good even with the contrast/brightness adjustment.

 

There's no problem with there being 3 apps that do the same thing as long as it's all to the benefit of the end user.

 

It's not my intention to write a third app. I just couldn't resist trying out some things with readily available tools. But I hope my experiments benefit both your applications.

 

To be clear, and without posting further images, I got the best results with the following algorithm:

 

- prepare source material (320x240, enhance contrast etc...)

- scale to 160x240

- split in 240 lines

- odd lines: pnmquant -spreadbrightness -meanpixel -floyd

- even lines: pnmquant -spreadluminosity -meanpixel -floyd

- merge

- remap to 256 colour atari palette, saturation 60

- remap to 128 colour atari palette, saturation 60

- scale to 320x240, no interpolation

 

This is exactly how the last LN image was created.

 

Best regards,

--Ivo

Edited by ivop
Link to comment
Share on other sites

Thanks for the info :) I'd totally forgotten about median cut algorithm before seeing your conversions were getting a better spread of colours than mine (and googling to see what pnmquant used) so hopefully adding that will improve it, even a little helps in the long run.

 

I'll have to try post process remap as well because I do my remap first. I also tried making the popularity count based on the RGB to A8 remapper then remap the whole RGB line again to that 4 colour A8 palette but that doesn't seem to work as well as pre-processing the image.

 

 

Pete

Link to comment
Share on other sites

Sorry to be here again.

 

PeteD, I think I understand what you're saying.

 

I changed the .txt into .bat.

I understand now (Height,... what I want to see and wich file I want to save,...)

 

But now, where in the .bat can I edit all the parameters I want?

 

Here is it again with the .bat and a LN2 screen (.gif) as an example.

Can you simply write the parameters that it converts the image into A8colours, this image screen height=144, wide=240 (1:1ratio) and to save into .mic (to use on G2F)?

 

If you can write this as an ex. than all the others will be simple filename changing for me...

 

Sorry, but I never done something like this.

 

Quantizator096.zip

 

Thanks and sorry to take your time.

Greetings.

José Pereira.

Link to comment
Share on other sites

You don't rename the readme.txt, create a new text file instead, rename that one to quant.bat (or any name.bat) and edit that.

 

quant.zip

 

That bat file contains these options

 

 

/h=-1 to stop the app rescaling the Y size

/mode=local checks local colour similarity

/dist=euclid to make the colour distance check work on euclidian logic

/lock=000000 to lock black (rgb 000000) as with that LN image that's one thing you need to do

 

 

Pete

Link to comment
Share on other sites

Did you put quant.bat in the same folder as the quantizator.exe? I just tested it and it works fine here.

 

Does the app work if you just drop the gif onto that exe? If not then the bat wont work either, you're still missing something from your PC.

 

 

Pete

Link to comment
Share on other sites

post-20947-126391013476_thumb.pngpost-20947-126391016798_thumb.png

post-20947-126391018793_thumb.png

Nice work guys, :thumbsup: :thumbsup: ....

 

But now try to rotate this Ninja picture 90 degrees, and try converting/quantizing again...I'm curious what the result will be.

 

Anyway, PM-underlays, PM-overlays and GED-type midscanline Palette-changes will help us more in that situation.

 

Remember: Midscanline changes in the left part of the screen are much coarser (due to RAM-refresh DMA cycles stolen), so the easiest would be to put all PM-underlays in the left part, and in the meantime prepare X,Y,Acc registers for GED-actions in the right part. Then some nice linear effects should be possible, I guess.

Link to comment
Share on other sites

post-20947-126391013476_thumb.pngpost-20947-126391016798_thumb.png

post-20947-126391018793_thumb.png

Nice work guys, :thumbsup: :thumbsup: ....

 

But now try to rotate this Ninja picture 90 degrees, and try converting/quantizing again...I'm curious what the result will be.

 

Anyway, PM-underlays, PM-overlays and GED-type midscanline Palette-changes will help us more in that situation.

 

Remember: Midscanline changes in the left part of the screen are much coarser (due to RAM-refresh DMA cycles stolen), so the easiest would be to put all PM-underlays in the left part, and in the meantime prepare X,Y,Acc registers for GED-actions in the right part. Then some nice linear effects should be possible, I guess.

 

Rotating it will mean more missing colours because there'll be more colours per line to quantize. At some points there's all that red, blue, grey, black, white, skin tones..

 

I'm just going to add as many options as I can to my stuff. 5 colour char mode is another possibility. You'll have very little time to change registers every modeline but then 5 colours per line may be worth it. Then of course there's working out which the 4th and 5th colours should be because you want them to not be in the same square. There's a LOT of options to support even 1/2 of what's possible with an app like this..

 

 

Pete

Link to comment
Share on other sites

This comes to my mind right now.

 

Stays with "Quantizator" like it is now:

1.)- 4majour colours and DLIs. and save as Image1.

2.)- Get another 4majour colours and save only this ones (omething like unused colours).

 

Now with G2F:

1.)- Load Point2 and do BMP->PMG (Rework if necessary this 4colours to fix in the 4PMGs. sizes, choose PRIOR mode and PMGs. size you want).

2.)- Load now the first one BMP and "voila".

 

Even in PRIOR0 you'll get an 8colours Picture.

 

What you say about this? It is possible, isn't it?

 

 

Greetings.

José Pereira.

Link to comment
Share on other sites

  • 3 months later...

Greetings, interesting app.

 

Q1How involved is the ditering here - Does it do ordered dither aware of the colour aproximations & hence additional error in the scanlines above/below

 

Q2 Has anyone tried a general converter using 4th tile colour. (even just one using 1 palette for the whole screen... i.e. trying to pick the most effective color for the 4th.

Edited by ceti331
Link to comment
Share on other sites

  • 1 year later...

Just playing around with it - does take it awhile to finish.

 

The longer you wait, the better result you get. Looking at the original picture I think that after a few hours of optimization the program should create almost exact copy.

 

Nice work. If I'm correct only DLIs are used to change the font of the playfield gfx. No PM gfx used, am I right? Especially interesting then

 

RastaConverter optimizes raster program and does multiple changes in each line of playfield colors, player colors and player positions. Player shapes are set once per line, players size is always *4.

Look at the created output files and/or sources for more information. The 1.0 version will be available soon.

Edited by ilmenit
Link to comment
Share on other sites

Having the ability of changing approx. 9 registers per scanline, it should be useful to have a closer look at the real "colour bits" ... Colourful pictures look different, when post-2756-0-91051000-1334953324_thumb.gif the bits get visuable...

 

One scanline stretched ...

post-2756-0-39675900-1334953493_thumb.gif

Edited by emkay
Link to comment
Share on other sites

What a great program! I am going to leave my machine on all night processing a couple of pictures on my dual core PC.

 

Feature Request:

Would it be possible to add a "Maximum Evaluations" parameter? I am working on an automation framework and would love to add this to it. However, I would need the program to stop at some point. If statistics could be written to a file, this would be great.

 

Feature Request 2:

Could a "Resume" feature be added so that you can continue where you finished last time?

Link to comment
Share on other sites

Nice work. If I'm correct only DLIs are used to change the font of the playfield gfx. No PM gfx used, am I right? Especially interesting then.

 

By the way, I made a mistake: I mean 'palette' instead of 'font' --> "Nice work. If I'm correct only DLIs are used to change the palette of the playfield gfx. No PM gfx used, am I right? Especially interesting then." (& Thanks, Ilmenit, for the answer.)

Edited by analmux
Link to comment
Share on other sites

If I'm correct only DLIs are used to change the palette of the playfield gfx. No PM gfx used, am I right? Especially interesting then." (& Thanks, Ilmenit, for the answer.)

 

this is bitmap mode, LMS per line, raster program, GED- g2f equivalent, PMG used

Link to comment
Share on other sites

Good ideas for features - both will be implemented.

 

New version of some files attached - replace the previous ones.

 

Changes:

- fixed bug in the generator (thanks to Jakub Husak)

- new options: /cdither, /dither, /init=less, /euclid

Now I have a good excuse to change my computer!

It would be nice if you'll make a simple graphic interface.

Link to comment
Share on other sites

Good ideas for features - both will be implemented.

 

- fixed bug in the generator (thanks to Jakub Husak)

- new options: /cdither, /dither, /init=less, /euclid

 

Thank you very much!

 

I just need a little advice now. I would like to use these pictures on the Atari. Will RastaConverter output files other than *.png? Then what is best to do, open the file with g2f or AIS? In other words, how can I actually use these wonderful new pictures?

 

p.s. I have a picture which I am converting. It has surpassed 3 million evaluations and it is still improving! :)

Edited by snicklin
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...