Jump to content
IGNORED

Quantizator


ilmenit

Recommended Posts

A short list:

Put the picture through the converter, to have the 160x240 pixel.

Check the available colours per line.

Check the available Atari colours.

Drop the colours down to a countable use, for the available colour changes and usable colours.... per line

Put the "original" picture again through the converter with the aimed "fitting" colours and use dithering for that.

 

This is exactly how /init=smart and /init=less work.

 

Preprocess (no matter what type of /init is chosen)

0. Input picture is converted to 160*height pixels -> output.png-src.png

0.1. Picture palette is converted to full Atari palette and dithering is applied if chosen -> output.png-dst.png

 

Initialization for /init=smart and /init=less:

In each line

1. /init=smart reduces the number of colors to the closest 12 Atari colours (8 with /init=less).

2. Colors are sorted by the number of pixels in the line (descending order)

3. In sort order colors are assigned to the playfield colors, then to sprite colors, then (if we have free cycles in the line) again to the playfield colors

4. Sprite positions are set to match the position of sprite color pixels

 

This works well for simple pictures, but gives worse results than /init=random for complex pictures, because the algorithm stuck in a local optimum.

Edited by ilmenit
Link to comment
Share on other sites

step 0.1 is in the wrong order. You'd have to leave the original palette there. If you turn to the Atari palette that early, the picture is full of transitions / dither pixels, because the filter wants to adjust all colours and brightness differences there.

It's better to have the Atari palette added, after the conversion is done.

It's just to make clear "before" using the A8 palette, how many colours could really be used for the final image.

 

Use that amount of colours, convert the picture with dither... then change to the Atari palette without any additional dither.

 

To add missing brightness steps, a variation of colours helps to keep details.

So if you need a brighter green, use a green with more yellow in it, instead of using the next brightness step of the "original" green, if you want a darker blue, use one with some green mixed into it. (for example).

In that way you get visuable details with always about 3 times of variation of one colour.

 

 

If you want to keep the dither methods, you could add some /dither=Atari or else.

Edited by emkay
Link to comment
Share on other sites

That won't work. Atari palette = 2^7 colours, 24 bit RGB = 2^24 colours. Most full-colour pictures even if they look to have one solid colour in an area in fact can have dozens of slight variations that you don't easily see.

 

What might work is a Posturize operation - reduce original image to 8 luma levels early on. But even then there's not a direct correlation when going to the Atari palette.

Link to comment
Share on other sites

step 0.1 is in the wrong order. You'd have to leave the original palette there. If you turn to the Atari palette that early, the picture is full of transitions / dither pixels, because the filter wants to adjust all colours and brightness differences there.

It's better to have the Atari palette added, after the conversion is done.

 

While the picture without dithering could look a bit better (I don't think that much better), it would be impossible to apply any reasonable dithering.

For dithering you would have only colors available at the current pixel palette. It was like that in the first published version of RastaConverter. You can check the terrible results there.

 

Also the color-distance caching implemented by Phaeron would not work (colors space would be too big) and the optimization process would be at least 100 times slower.

Edited by ilmenit
Link to comment
Share on other sites

wow, thats clean and nice

 

Well, the A8 has a huge palette. So we should use it ;)

 

 

The pilgrim picture is a bit difficult, just because it is done particular for this resolution and the 64's colour density. So we have restrictions here. But "real" pictures always can be used with all available colours ... and dither only, where it is really needed.

Link to comment
Share on other sites

Interestingly, for the C64, for strait, non-interlaced, 16-color images, where one knows how that specific limited pallette and the manner of how those colors may be displayed in each cell, one might be able to develope rules that reduce the possible variables to that set, giving fewer permutations to sift through. Limits in the A8's ability to display certain colors in certain instances can borrow from how colors are often dithered on the C64 to produce images, through the use of available complimentary colors or picking a color of a particular shade, etc.

Link to comment
Share on other sites

Summer picture , resized to 160x240 indexed colours, adjusted to laoo palette.

 

Ok, photo was not the best picture to explain what I mean - it still looks OK with many details lost f.e. on palm trees.

Here are the pictures with 'knoll' dithering (400K evaluations) and with 'simple' dithering (40M evaluations).

Still you can see how much more details they have.

post-22831-0-64454400-1338821526_thumb.pngknoll.xex

post-22831-0-36371400-1338821529_thumb.pngsimple.xex

 

and 'knoll' dithering (400K evaluations) with Laoo palette:

post-22831-0-93955300-1338823566_thumb.pnglaoo.xex

 

The Pilgrims picture from my previous post is much more complex to process. Also the "Happy Teddy":

post-22831-0-91034100-1338821701_thumb.png

 

Btw, what GFX program did you use for color reduction and remapping? The dithering on the sky looks nice and I wonder what kind of algorithm is used there.

Edited by ilmenit
Link to comment
Share on other sites

 

Btw, what GFX program did you use for color reduction and remapping? The dithering on the sky looks nice and I wonder what kind of algorithm is used there.

 

An almost 16 years old tool. The dither is quite similar to "chess" ... it's just that the colours have been adjusted, as I wrote above.

Link to comment
Share on other sites

Robocop "Final" ;)

 

post-2756-0-17589500-1338838036_thumb.png

 

Robocop.xex

 

Sepia "Final"...

 

post-2756-0-56042900-1338838150_thumb.png

 

sepia.xex

 

"Beast" ...

 

Particuler this shows where the difference is:

 

As the converter tries to mix some colour in, that looks "by value" fitting better to the brightness, but doesn't fit to the image at all, this picture uses a colour offset from brown to green to light brown, to have the details.

 

post-2756-0-61413300-1338838300_thumb.png

 

beast.xex

 

 

 

 

 

 

Link to comment
Share on other sites

The beast pic has come out quite well! I've found the g2f version that I did back in 2004 this morning and I've started repixelling the skeletal part this evening with a rare bit of free time. Prob won't get chance to finish it though tonight.

 

Here's my pic in progress, still lot of pixelling to do on the skeletal remains. I'm using GED+ (char) mode now, the original one i created was regular dli's.

post-4724-0-84543200-1338854134_thumb.png

Edited by Tezz
Link to comment
Share on other sites

Oh, you guys and your hi-color Atari pics... ;)

 

Automatic images are nice, but it is good to see what skilled pixel artists/hackers,like Tezz here, who have worked within a certain limitation set, could do with this. It doesn't replace them, just opens up more possibilities. Eventually, when some manual editor is created, it should be amazing.

 

But, despite all of the cheats we poke around with, to try and get faster results, sometimes we just have to accept that it will take a bit of time to get optimum pictures, even if it means going bald. ;)

 

Here's a little work in progress of an image that because of its' smooth gradients and semi-monochrome pallete, will have any incongruities stick out like a Hitch-Hikers thumb. So, I'm going to let lt grind away until a result I will settle for comes up.. or I can't stand it anymore. So far around 600M (yes, AN is that crazy/patient) and it could be over a billion transitions before I'm satisfied. The trouble area is on the left-hand side, about a quarter across, like usual, but I'm willing to see if the program can ferret out something, eventually. I'll try playing around with different dithering levels and masks, if I have some other goes at at it, and I likely will because of a certain iconic nature it has for me and probably some others here - hey why not have a go, yourselves? :)

post-3306-0-00310500-1338859878_thumb.png

  • Like 1
Link to comment
Share on other sites

Oh, you guys and your hi-color Atari pics... ;)

 

Automatic images are nice, but it is good to see what skilled pixel artists/hackers,like Tezz here, who have worked within a certain limitation set, could do with this. It doesn't replace them, just opens up more possibilities. Eventually, when some manual editor is created, it should be amazing.

 

Tezz's picture is done in a different environment. The charmode offers 5 colours and the picture uses up to 9 colours.

 

 

But, despite all of the cheats we poke around with, to try and get faster results, sometimes we just have to accept that it will take a bit of time to get optimum pictures, even if it means going bald. ;)

 

 

Many pictures ran through 1000 million and more, but the "wrong" colours put colours in, that sometimes cause "unsolvable solutions", and the lines won't be removed. That why I propose the presuming of the colours, which is easily to solve. You know, ... at the end there is a max. of usable and available colours and the converter has this limits anyways. But it doesn't get bothered with wrong placed colours that cause those lines on the screen.

Link to comment
Share on other sites

Many pictures ran through 1000 million and more, but the "wrong" colours put colours in, that sometimes cause "unsolvable solutions", and the lines won't be removed. That why I propose the presuming of the colours, which is easily to solve. You know, ... at the end there is a max. of usable and available colours and the converter has this limits anyways. But it doesn't get bothered with wrong placed colours that cause those lines on the screen.

 

There is a max. of usable colours, but it can't be predicted. You can limit the number of colours per line to 8 or 12 in the input picture, but you may loose details then. With RastaConverter it is possible (but not guaranted) to have up to 10 changes of color in line which with initial state (4 PF colors + 4 sprite colors) gives up to 18 colors in line. The only good way of removing the conversion artifacts (horizontal lines) is by hand and the editor is needed for that. Maybe you should ask Tebe to improve the G2F to load RastaConverter output. Or someone could do an editor basing on the RastaConverter code (I won't do it, I find GUI programming too boring).

 

I still think that the direct conversion by RastaConverter is much more close to the original than preprocessed by you... With Laoo palette:

 

Your version | Original | RastaConverter (default)

post-22831-0-18343300-1338890776_thumb.pngpost-22831-0-69029500-1338890743_thumb.jpgpost-22831-0-76861300-1338890808_thumb.png

rastabeach.xex

Edited by ilmenit
  • Like 1
Link to comment
Share on other sites

It's impressive what you've achieved with automation. It'll be a great time saver in creating/converting pictures when you're able to finalise the results with manual editing. IMHO the editor should be G2F and not creating a new one. Hopefully as you say Tebe will be interested to work on importing the results with you.

 

With regard to the processing methods suggested, there will be occasions (or sections of the picture) that will work out better one way or the other for sure. I don't see a way of making a one method fits all solution. That's where manual intervention will come in and once you can edit the results you'll be able to cut and paste and rework things until the picture is as good as it can be.

Edited by Tezz
Link to comment
Share on other sites

Many pictures ran through 1000 million and more, but the "wrong" colours put colours in, that sometimes cause "unsolvable solutions", and the lines won't be removed. That why I propose the presuming of the colours, which is easily to solve. You know, ... at the end there is a max. of usable and available colours and the converter has this limits anyways. But it doesn't get bothered with wrong placed colours that cause those lines on the screen.

 

There is a max. of usable colours, but it can't be predicted. You can limit the number of colours per line to 8 or 12 in the input picture, but you may loose details then. With RastaConverter it is possible (but not guaranted) to have up to 10 changes of color in line which with initial state (4 PF colors + 4 sprite colors) gives up to 18 colors in line. The only good way of removing the conversion artifacts (horizontal lines) is by hand and the editor is needed for that. Maybe you should ask Tebe to improve the G2F to load RastaConverter output. Or someone could do an editor basing on the RastaConverter code (I won't do it, I find GUI programming too boring).

 

I still think that the direct conversion by RastaConverter is much more close to the original than preprocessed by you... With Laoo palette:

 

Your version | Original | RastaConverter (default)

post-22831-0-18343300-1338890776_thumb.pngpost-22831-0-69029500-1338890743_thumb.jpgpost-22831-0-76861300-1338890808_thumb.png

rastabeach.xex

 

The lines do not really aid the details.

But , as you might see. The sky suffers by the huge brightness steps, while the palms lose their shape in the line-mist.

 

My picture was a fast conversion, not having the exact possible colours at every scanline. But the software can do the comparisions fast. And if needed, the picture has to be redrawn with possibly a "green" less and some better spreaded sky-dither, to have the image at the best possible solution.

Link to comment
Share on other sites

 

 

The Pilgrims picture from my previous post is much more complex to process.

 

What's your best result of that picture.

 

Possibly it's not that hard to have the pictures "well" on the A8. As the colorization of The C64 is already weird, some strange lines do not really disturb the image there.

 

 

post-2756-0-68304600-1338978954_thumb.png

 

pilg200m.xex

 

let's wait for 1000M ...

Link to comment
Share on other sites

Did you preprocess the picture manually lowering the number of colours? Can you paste your destination picture?

Here is the picture of original height (/h=200 /filter=box /pal=laoo) without any preprocess after 1100M:

post-22831-0-78144800-1338979604_thumb.pngpilgrims.xex

C64 Original:

post-22831-0-34253800-1338979608_thumb.png

 

Even after 1100M evaluations the output picture still gets improved.

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...