Jump to content
IGNORED

Quantizator


ilmenit

Recommended Posts

OK, I'm not an expert in these techniques by far, but isn't it a bug anyway when converting a picture needs millions of steps & a lot of time? Even when the converter is running on PC?

 

You can compare this problem with the problem of a computer playing chess, where you need a really capable machine to beat a human.

 

- Chess has 64 fields with 32 pieces. Every move has consequences for the following move. Given a specific board layout, find the winning moves (the less the better).

 

- On a line basis, we have 160 positions and 8 'image'-values, where some of the image values (PMGs) can only cover discrete spans and have a reduced resolution and dependency to other image values (priority). We are only able to apply a fixed number of changes (position, image value, colour value etc.) per line, and every change has consequences for the following line. Find a combination of (register-) values for the complete image, where the visual difference to the original should be minimal.

 

Clearer?

 

I would expect such a tool to run a lot lot faster. Or did you use a slow compiler / interpreter programming language?

 

I checked also the assembly representation of the compiled core routines (the time consuming ones). Without a change of the algorithm, solving principle, there isn't much to get.

  • Like 2
Link to comment
Share on other sites

That darker pixels have - in no way- something to do with that basic hill climbing algorithm. There is a calculation bug happening, but emkay is the bad boy .... lol

 

http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect

 

Halbwissen, gepaart mit Unvertändnis , unterstützt durch einen Link auf eine zu 80% korrekte Quelle, wobei der Inhalt am Thema vorbei zieht.

Ganz großes Kino.

 

Noch interessanter ist, dass du so einen Mist hier postest, nachdem meine Aussage bewiesen ist.

Edited by emkay
Link to comment
Share on other sites

Is there any advantage in using a /s value >1 ? What sort of value should it be given, 10's,100's?

 

I thought it could help to leave the local optimum, but in practice a simple hill climbing gives result much faster. There are three reasons for that:

1. The more worse solutions you store, the more worse cases you have to mutate and test. There is no guarantee that mutated solution will be better (especially after some time), so with 'n' solutions stored, the whole process slows down 'n' times.

2. If you store 'n' best pictures on the list, they are usually very similar and the algorithm climbs the same hill or near hills.

3. The initial random state of registers have the biggest influence on the final picture.

 

The biggest problem is that in the huge search space there is a lot of peaks and most of them have very similar maximum. There are some heuristics implemented to leave the local optimum, but they are not perfect (mutated solution is usually worse, so if they are applied to often, the whole process slows down).

I have tried also genetic algorithm with 'n' solutions to be crossed, but then - again - the list of best solutions starts to have very similar solutions quick and process slows down many times.

 

Everything depends a lot on the initial (random) state of the registers, so it is best to run a few instances of RastaConverter to see which output you like most. It is written in the help file, btw :)

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

I guess, it's getting more clear , why the hires C64 pictures were rather fast adopted.

C64 has the 16 colours, the restriction of using them were stronger in hires than in colour mode. So the colour-resolution usage gets lower, and more transition pixels get used.

Converting those pictures to the A8 resolution, makes it possible to turn a transition of "blue&pink" , using the fitting value in the image. So no detail is lost there. Browns get mixed to different lumas on the C64 with grey pixels, where the A8 simply has the "up to 32 brown tones" .... so no detail is lost there.

 

This one is now at 80M evaluations...

output.xex

post-2756-0-01096100-1341673506_thumb.png

Link to comment
Share on other sites

Can I interrupt you and ask for a favour?

 

I re-painted using PAINT the Cybernoid2 Loading screen to other colours that would fit better on a Cybernoid2 A8 version ;) and just because you seems best and better than me, can you try this picture and put here the results?

post-6517-0-06808600-1341509543_thumb.png

Here we have the '.png' using P.C. PAINT colours but when I tried to Load it into G2F using Laoo Pallete I get this (of course there's colour clash in a direct ColourMap VBXE version, but I think it would look better with Rasta's Converter and on a stock XL/XE Machine) and are, more or less, the colours I am expecting to get on A8:

post-6517-0-63957700-1341509709_thumb.png

 

A help would be very much appreciated.

Thanks.

Hi. Sorry to upset again but as this doesn't not seem to be my type, could anyone here try the first/top picture?

Please.

Thanks.

 

 

P.S.- I tried yesterday a picture into that INTEGRATOR program and it doesn't accept (G2F has that 'JMP 10').Will it be possible to have this so that we can join the screens to create a slideshow or even use them as Loading screens for games or other programs?

Edited by José Pereira
Link to comment
Share on other sites

 

Hi. Sorry to upset again but as this doesn't not seem to be my type, could anyone here try the first/top picture?

Please.

Thanks.

 

 

It's now at 70M evaluations...

 

 

 

post-2756-0-87297800-1341852564_thumb.png

 

70m.xex

 

More than 4 pictures at the same time, isn't useful here, and the PC is off when I'm not at home.

 

They run in lowest priority, so it don't interrupt my work on the PC :D

Edited by emkay
  • Like 2
Link to comment
Share on other sites

Hi. Sorry to upset again but as this doesn't not seem to be my type, could anyone here try the first/top picture?

Please.

Thanks.

 

 

It's now at 70M evaluations...

 

 

 

post-2756-0-87297800-1341852564_thumb.png

 

70m.xex

 

More than 4 pictures at the same time, isn't useful here, and the PC is off when I'm not at home.

 

They run in lowest priority, so it don't interrupt my work on the PC :D

Thanks. It looks good.But as I said, this is not my type... What possibilities you have to get a little bit less of those colours/lines?

Link to comment
Share on other sites

Hi. Sorry to upset again but as this doesn't not seem to be my type, could anyone here try the first/top picture?

Please.

Thanks.

 

 

It's now at 70M evaluations...

 

 

 

post-2756-0-87297800-1341852564_thumb.png

 

70m.xex

 

More than 4 pictures at the same time, isn't useful here, and the PC is off when I'm not at home.

 

They run in lowest priority, so it don't interrupt my work on the PC :D

Thanks. It looks good.But as I said, this is not my type... What possibilities you have to get a little bit less of those colours/lines?

 

At the current state, wait till 2000 M Evaluations?

Link to comment
Share on other sites

Thanks. It looks good.But as I said, this is not my type... What possibilities you have to get a little bit less of those colours/lines?

 

Use the details mask (/details, /details_val) to provide a hint to the algorithm which parts of the pictures you want to look best (here: rays, moon, second spaceship). I will convert the picture for you when I get to a stronger computer.

Edited by ilmenit
Link to comment
Share on other sites

P.S.- I tried yesterday a picture into that INTEGRATOR program and it doesn't accept (G2F has that 'JMP 10').Will it be possible to have this so that we can join the screens to create a slideshow or even use them as Loading screens for games or other programs?

 

Did you try the newest version?

http://arsoft.netstrefa.pl/programy.htm#integrator310

Link to comment
Share on other sites

P.S.- I tried yesterday a picture into that INTEGRATOR program and it doesn't accept (G2F has that 'JMP 10').Will it be possible to have this so that we can join the screens to create a slideshow or even use them as Loading screens for games or other programs?

 

Did you try the newest version?

http://arsoft.netstr...m#integrator310

 

yes, thanks.

That was the problem. the new one works.

Link to comment
Share on other sites

From what I can tell, RastaConverter simulates what I implemented, which is to reload the sprite's shift register whenever the position counter matches. Atari800 and Atari++ are drawing both sprite images in full. Neither behavior is correct. Based on tests I've done on the real hardware, this is what should happen:

 

Phaeron, do you still have this test program with sources?

Link to comment
Share on other sites

From what I can tell, RastaConverter simulates what I implemented, which is to reload the sprite's shift register whenever the position counter matches. Atari800 and Atari++ are drawing both sprite images in full. Neither behavior is correct. Based on tests I've done on the real hardware, this is what should happen:

 

Phaeron, do you still have this test program with sources?

 

Yes, I do -- attached. Keys are [shift]+Z/X to change the sprite data, V to change the width, and N/M to change the horizontal position.

midsprite.zip

Link to comment
Share on other sites

This picture needs some bugreport ;)

 

Have a look at the band besides the Dragon's mouth.

This band destroys the image on the 1st view. It's just some dots inside the mouth and that huge band outside. On what calculation is this decision based?

 

post-2756-0-02091300-1342509265_thumb.jpg

 

If this "feature" is corrected, images , particular like this one, get real breathtaking.

 

The solution could be to use one of the "gold" colours for the dragon's mouth and to keep the line white. But why is it bright pink?

Link to comment
Share on other sites

I have uploaded RastaConverter Beta5 here:

http://github.com/il...erter/downloads

 

1. The "Tabu Search" algorithm has been replaced with amazing "Late Acceptance Hill Climbing" algorithm for /s greater than 1.

post-22831-0-65808700-1342544158_thumb.png

It works slower at the beginning, but after many (100M+) evaluations, when basic Hill Climbing almost stops, this algorithm still finds better solutions! The more solutions you use, the better final result can be. There is no memory impact so you can use even /s=10000 or more.

 

2. Added Preprocess parameters - can be useful for GUI preview:

  • /preprocess If this switch exists then RastaConverter generates and saves only destination picture.
  • /brightness Brightness color corection.
  • /contrast Contrast color corection.
  • /gamma Gamma color corection.

3. Random Number Generator changed to Marsenne Twister for a longer period.

  • /seed - if exists the constant seed for the random number generator is used

4. Limiting palette

  • /picture_colors - limits palette to colors existing in the destination picture. No average colors will be used.

5. Fast processing of low color (<5) pictures, where sprites are not needed

6. You can periodically save the results of RastaConverter

  • /save - saves best solution after every 'n' evaluations

7. Default distance function for preprocess is set to CIEDE2000. Then default /distance function is used.

  • /predistance - sets color distance function for preprocess

8. I have tried to add multithreading, but with the current optimizations of the raster program execution it is very problematic to add - too many dependencies on global variables :(

9. Many minor fixes

Edited by ilmenit
  • Like 3
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...