Tiled palette quantization tool

Discussion of hardware and software development for Super NES and Super Famicom. See the SNESdev wiki for more information.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
Rilden
Posts: 21
Joined: Wed Jun 22, 2022 5:34 am

Re: Tiled palette quantization tool

Post by Rilden »

You can left click on the generated images to save them.
93143
Posts: 1717
Joined: Fri Jul 04, 2014 9:31 pm

Re: Tiled palette quantization tool

Post by 93143 »

Doesn't help. I get a better name that way, but the scatter is still there; either way I do it, the default nebula pic is 109 colours instead of 32.
User avatar
Gilbert
Posts: 564
Joined: Sun Dec 12, 2010 10:27 pm
Location: Hong Kong
Contact:

Re: Tiled palette quantization tool

Post by Gilbert »

Maybe it's your browser's setting?
Some browsers have an option to compress webpages in order to reduce bandwidth(said to be most useful when you have limited bandwidth such as a mobile connection), which may "help" you by lossy compressing the images in the page.
Last edited by Gilbert on Sun Sep 11, 2022 4:49 am, edited 1 time in total.
93143
Posts: 1717
Joined: Fri Jul 04, 2014 9:31 pm

Re: Tiled palette quantization tool

Post by 93143 »

Lossless compression wouldn't cause any data corruption, which is why it's called that. Did you mean the opposite? Also, I don't see a setting for that.

And like I said, downloading the same picture from this forum, instead of from Rilden's web tool, works perfectly fine.

It could be something in the scripting that's triggering a bug in the browser...
User avatar
Gilbert
Posts: 564
Joined: Sun Dec 12, 2010 10:27 pm
Location: Hong Kong
Contact:

Re: Tiled palette quantization tool

Post by Gilbert »

Corrected my last post now.
Right, I was saying lossy compression.
It's hard to kepp stuff errorfree when typing on this small screen on my phone.
turboxray
Posts: 348
Joined: Thu Oct 31, 2019 12:56 am

Re: Tiled palette quantization tool

Post by turboxray »

What Gilbert said. That definitely sounds like some sort of memory saving or compression thing on the browser. Odd that it would be for the IO page but not the forum.



Another good feature that would be nice to have, is that for the 'common' color, that it search the whole image for the more used color (after bit depth correction) and uses that. That way you don't have to guess with the 'eye dropper'.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Tiled palette quantization tool

Post by lidnariq »

I vaguely suspect it's there to prevent so-called "Canvas fingerprinting" (wherein a web site can uniquely identify you based on how HTML Canvas elements behave based on exactly what is on your machine).
Rilden
Posts: 21
Joined: Wed Jun 22, 2022 5:34 am

Re: Tiled palette quantization tool

Post by Rilden »

The reason for the scattered colors is called fingerprint randomization. The Brave browser modifies randomly 3 percent of the canvas pixels, so that the hash of the pixels will be unique.
This is done for each canvas element, so even the palette image is affected:
carina-8x8-8p4c-u-palette.png
carina-8x8-8p4c-u-palette.png (1.94 KiB) Viewed 4603 times
This image was downloaded using Brave, and has 118 unique colors instead of 32.
These are the pixels with the modified value:
carina-8x8-8p4c-u-palette-wrong-pixels.png
carina-8x8-8p4c-u-palette-wrong-pixels.png (1.96 KiB) Viewed 4603 times
The reason why downloading pictures from this forum work correctly is because they are not canvas elements.
You can disable fingerprint randomization by clicking the Brave Shields icon to the right of the web address, go to Advanced controls and select Allow fingerprinting.
93143
Posts: 1717
Joined: Fri Jul 04, 2014 9:31 pm

Re: Tiled palette quantization tool

Post by 93143 »

That works great; thanks! Problem solved.

Good to know about too...
GValiente
Posts: 11
Joined: Mon Sep 12, 2022 12:17 am

Re: Tiled palette quantization tool

Post by GValiente »

Hi, thanks a lot for this tool, it works great.

Would it be possible to generate the output images in indexed mode, instead of 32bit RGB mode?

Thanks.
Rilden
Posts: 21
Joined: Wed Jun 22, 2022 5:34 am

Re: Tiled palette quantization tool

Post by Rilden »

I have to look into this, but I think I can make the output save as an indexed color bmp when clicked.
turboxray
Posts: 348
Joined: Thu Oct 31, 2019 12:56 am

Re: Tiled palette quantization tool

Post by turboxray »

What about the ability to give it an existing palette file and have it convert the image under that spec?
Rilden
Posts: 21
Joined: Wed Jun 22, 2022 5:34 am

Re: Tiled palette quantization tool

Post by Rilden »

Can't the other tools do that already?

I can convert the image with an existing palette, but how would the palette file look like? An image with palette colors, like my tool's palette output, or a text file with a list of rgb values?
turboxray
Posts: 348
Joined: Thu Oct 31, 2019 12:56 am

Re: Tiled palette quantization tool

Post by turboxray »

Rilden wrote: Sun Sep 18, 2022 2:51 am Can't the other tools do that already?

I can convert the image with an existing palette, but how would the palette file look like? An image with palette colors, like my tool's palette output, or a text file with a list of rgb values?
Yeah, take an input palette png like the one you output.
I have my own tool (and it can do this), but honestly the results aren't quite as nice as yours - other tools I've used are even worse than mine haha. Sometimes I get weird matches for distances. I was using CIELAB color space - ehh. Plus, my "scoring" system for picking the best one was also too simplistic.
User avatar
Individualised
Posts: 310
Joined: Mon Sep 05, 2022 6:46 am

Re: Tiled palette quantization tool

Post by Individualised »

Rilden wrote: Sun Sep 18, 2022 2:51 am Can't the other tools do that already?
What I think they're suggesting would be useful for generating NES images. I don't think they mean quantising a whole image to a preset palette without the tile and palette stuff your tool already does, as many tools for that of course already exist.
Post Reply