What happened to the adaptive palette?

Ask for help and post your question on how to use XnView Classic.

Moderators: XnTriq, xnview

Aolei
Posts: 9
Joined: Tue Dec 21, 2004 10:43 pm

What happened to the adaptive palette?

Post by Aolei » Mon Jun 24, 2013 7:09 am

I am wondering what happened to the "Convert to Colours" with Adaptive palette.

Is the "None" option equivalent? If so then I suppose the algorithm doesn't work as well for me as I think it used to as white backgrounds often get changed to a pale colour (I would have thought when white was the predominant colour it should be retained by an adaptive algorithm). Perhaps this is what was referred to by XnTriq in
http://newsgroup.xnview.com/viewtopic.p ... ive#p51429
"When it comes to reducing color depth, XnView's old adaptive method was – and IMO still is – the most bestest
universally applicable. Unfortunately it has been replaced (somewhere along the way between version 1.70 and
1.80) by the current non-dithering algorithm. Therefor v1.70.4 will always have a special place on my HDD, unless
I can convince Pierre to reconsider."

(I used to find this option very useful for reducing screen shots to a reduced set of colours so they become much more compressible... I think increasingly software is doing anti-aliasing on graphics which are basically just made up of a few panels of constant colour and coloured lines... the result is far more colours in the screenshot, most of which add little to the capture)

User avatar
xnview
Author of XnView
Posts: 31887
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: What happened to the adaptive palette?

Post by xnview » Mon Jun 24, 2013 7:48 am

could you post an example with previous and current method?
Pierre.

Aolei
Posts: 9
Joined: Tue Dec 21, 2004 10:43 pm

Re: What happened to the adaptive palette?

Post by Aolei » Mon Jul 01, 2013 11:39 pm

My objective is to reduce the number of colours as much as possible without significantly changing the appearance of the graphic.
What this achieves is a reduction in size of the file.
I like to use 'lossless' PNG to do this
The graphics I am reducing is essentially a kind of line art or cartoon type graphic with panels and lines of constant colour. Although the input appears to have only 10 distinct colours, the number of colours is numerous because anti-aliasing was applied by the program that generated the graphic (I believe the total number of colours is 208). Effectively what I am seeking to do is remove the anti-aliasing and get back to the principal colours of the graphic.
The white background is the dominant colour in the graphic and one that I do not wish to change. As the most numerous cell colour I would expect a clustering algorithm would normally not change that colour.
I have found that the best way to reduce the colours is often to step down in increments until the graphic changes significantly - and then back out one step.
Using the old Adaptive palette option (I used version 1.90.2.0 iof XnView) I can go 256->216->128->64->32 colours on this example. At that point the graphic changes significantly... so I back off to 64 colours and it looks similar to the original and the background remains white.

Repeating the same operation in the current version of XnView I can go 256->128. At that point the background becomes non-white. I can go to 64 colours and then manually edit the palette to set the background to white but this seems more laborious (sometimes it is hard to detect whicih palette entry is the background one)

Here are the requested examples:
Original Image: http://imageshack.us/a/img594/4100/gt38.png
Colours reduced with XnView 2.0.3: http://imageshack.us/a/img706/2301/nhyj.png
Colours reduced with XnView 1.90.2.0: http://imageshack.us/a/img577/7369/7nf.png


[Thanks for the good support you do and the application - I will probably register nconvert as it seems to have a separate license now and I would like to have it on my work machine... I found the price a bit steep... and went into shock when I saw the exchange rate loading that Digital River seemed to be imposing on top of whatever they take on all sales (14%?). I think I can get around that by paying in Euros with my USD credit card and letting my credit card company do the exchange rate conversion. I hope that works!]

User avatar
XnTriq
Moderator & Librarian
Posts: 5456
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: What happened to the adaptive palette?

Post by XnTriq » Tue Jul 02, 2013 1:30 am

Out of curiosity, I took Aolei's original image…
… and reduced the color depth to 4-bit (16 colors) with Corel PHOTO-PAINT v11:
I find the result pretty impressive, especially if we consider how old (2002) this software is.

eL_PuSHeR
Posts: 267
Joined: Sat Apr 25, 2009 9:23 am

Re: What happened to the adaptive palette?

Post by eL_PuSHeR » Tue Jul 02, 2013 6:20 am

Yep, Corel's convesion is quite nice specially taking into account it's only 16c (4bpp) as opposed as original poster's Xnview 64 colours samples.

PS - I achieved similar results using a Dennis Lee reduction colour algorithm using an 8bf plugin. I think old Corel's result is the best.

PS2 - There is no reason to reduce number of colours for this particular image. The original one has got 208 different colours. I used Ken Silverman's PNGOUT on it and the size was reduced from 38KB to 16,3KB (very similar size to all other 4bpp samples -> 14,2KB). 64 colours ones are 15,4KB/15,5 KB.

As you may see there is little size difference among all samples.
Intel i7 5960X
Gigabye GA-X99-Gaming 5
8 GB DDR4 (2100)
GeForce GTX 970 (Gigabyte)

User avatar
XnTriq
Moderator & Librarian
Posts: 5456
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: What happened to the adaptive palette?

Post by XnTriq » Wed Jul 03, 2013 5:30 pm

Aolei wrote:Although the input appears to have only 10 distinct colours, the number of colours is numerous because anti-aliasing was applied by the program that generated the graphic (I believe the total number of colours is 208). Effectively what I am seeking to do is remove the anti-aliasing and get back to the principal colours of the graphic.
This is what I usually do before I start taking screenshots:

Aolei
Posts: 9
Joined: Tue Dec 21, 2004 10:43 pm

Re: What happened to the adaptive palette?

Post by Aolei » Wed Jul 03, 2013 8:52 pm

XnTriq wrote:
Aolei wrote:Although the input appears to have only 10 distinct colours, the number of colours is numerous because anti-aliasing was applied by the program that generated the graphic (I believe the total number of colours is 208). Effectively what I am seeking to do is remove the anti-aliasing and get back to the principal colours of the graphic.
This is what I usually do before I start taking screenshots:
Thanks - those are interesting links. I hadn't realized the Clear Type could affect screenshots. I will have to experiment with this later. However, for day-to-day use it isn't very practical as I would be turning Clear Type on and off all the time. I wonder if this is also affecting the on-screen OCR capture of text I sometimes do... the quality of that is variable... sometimes excellent and sometimes much less so - I use Capture2Text for that capability.
(minor side-thought - maybe one day the computer will track my eye movement and correct for Abbe index colour separation in peripheral vision caused by my prescription glasses... it is getting to be a nuisance on today's large screens)

I suppose what I am dreaming of is something which can undo anti-aliasing (or on other occasions, undo the JPEG artifacts). Some kind of way of modelling an input with some assumptions to sort between presumably non-unique solutions. In the case of undoing anti-aliasing the perfect solution would probably have to resize the graphic at the same time as it is resizing which often causes the anti-aliasing to take place. It also may not be as trivial as I imagine... just clustering the colours and trying to pick the hues which occupy the most pixels may not be the way to go as (for example) a white background with a single pixel line might have a line of anti-aliased pixels on each side of the line such that the anti-aliased hue occupies more pixels than the line itself.

User avatar
XnTriq
Moderator & Librarian
Posts: 5456
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: What happened to the adaptive palette?

Post by XnTriq » Thu Jul 04, 2013 2:00 am

Aolei wrote:I hadn't realized the Clear Type could affect screenshots. I will have to experiment with this later. However, for day-to-day use it isn't very practical as I would be turning Clear Type on and off all the time.
To be honest, I have sub-pixel anti-aliasing turned off most of the time anyway, because I prefer bi-level rendering over grayscale font smoothing and ClearType.
Of course this depends on the display (CRT vs. LCD etc.), and it's also a matter of personal taste.
Aolei wrote:I wonder if this is also affecting the on-screen OCR capture of text I sometimes do... the quality of that is variable... sometimes excellent and sometimes much less so - I use Capture2Text for that capability.
You make an interesting point!
Aolei wrote: In the case of undoing anti-aliasing the perfect solution would probably have to resize the graphic at the same time as it is resizing which often causes the anti-aliasing to take place.
There's another rare feature in Corel's PHOTO-PAINT: It allows for resampling without anti-aliasing.

User avatar
Drahken
Posts: 884
Joined: Sun Apr 10, 2005 4:29 pm

Re: What happened to the adaptive palette?

Post by Drahken » Fri Jul 05, 2013 8:20 pm

You can try some of the ximagic plugins for your images: http://newsgroup.xnview.com/viewtopic.php?f=38&t=25115

Another possible method is to reduce the colors to a point where the white turns yellow or whatever, then either adjust levels (hotkey "L") or brightness/contrast (hotkey "shift+E") until the "white" turns white again, without mucking up the other colors too much.
For example; I took your pic, reduced it to 64 colors (which turned the white into a pale yellow), then did each of the above methods to bring it back close to original colors:
levels adjust: http://allspark.net/cypherswipe/adaptive-color-1.png
brightness/contrast adjust: http://allspark.net/cypherswipe/adaptive-color-2.png

EDIT: Try this: http://allspark.net/cypherswipe/adaptive-color-4.png
This uses 16 colors. I got it by using the ximagic plugins: xiquantizer -> quantization -> 16 colors -> wu

EDIT 2: As eL_PuSHeR mentioned, there's no need to reduce colors on this pic, truecolor actually gets smaller filesizes. However, there is also no need for PNGOUT. All you have to do is export the original image from xnivew (file->export, or ctrl+alt+s) then choose png, set compression to 9 and set filter to "none", this results in a 15.76KB image.
Oh the feuhrer, oh the feuhrer, oh the feuhrer's nipples bonk!

Aolei
Posts: 9
Joined: Tue Dec 21, 2004 10:43 pm

Re: What happened to the adaptive palette?

Post by Aolei » Wed Jul 10, 2013 5:22 am

OK - I experimented with the Clear Type setting and here are my discoveries:
(Environment: Windows 7 Pro x64, NVIDIA Quadro 6000)

Firstly, Windows 7 is a bit tricky about turning Clear Type off.
Once you have opened the "Adjust Clear Type text"/"Clear Type Text Tuner" panel and unchecked it, the change does not take effect in a window until you click the 'Next' button and also click on the original window to give focus to it. Then you need to Cancel out of the series of screens where it prompts you to tune your display(s). Basically if you try and turn it off it will then try to get you to 'tune' your displays and if you answer honestly about which looks best you may well find it has turned it back on. Kind of "User thinks he/she wants Clear Type off but obviously prefers it on so user is a dummy and we will turn it back on".
On the other hand - if you try and cancel out straight away the change does not take effect. There is no "OK" or "Apply". You have to hit "Next" the first time.

Secondly, it indeed reduces the number of colours in a screen capture (using the OneNote Windows-S key method). e..g for one of my graphics the capture is reduced from 352 to 242 colours (even that seems a lot for a graphic with no multi-color 'image' on it.

Thirdly, While most of the image appeared unchanged when I turned off Clear Type, some small font coloured text became very faint and hard to read. So this means I probably do not want to do this (as well as the bother of toggling it on and off all the time).

Lastly, I did some experiments with the Capture2Text screen OCR utility and there didn't seem to be much difference in recognition rates between having Clear Type turned on or turned off.

Drahken wrote:You can try some of the ximagic plugins for your images: http://newsgroup.xnview.com/viewtopic.php?f=38&t=25115

Another possible method is to reduce the colors to a point where the white turns yellow or whatever, then either adjust levels (hotkey "L") or brightness/contrast (hotkey "shift+E") until the "white" turns white again, without mucking up the other colors too much.
For example; I took your pic, reduced it to 64 colors (which turned the white into a pale yellow), then did each of the above methods to bring it back close to original colors:
levels adjust: http://allspark.net/cypherswipe/adaptive-color-1.png
brightness/contrast adjust: http://allspark.net/cypherswipe/adaptive-color-2.png
Interesting, though I don't really want to buy anything else, nor do I want to have to do multiple operations.
Drahken wrote:EDIT 2: As eL_PuSHeR mentioned, there's no need to reduce colors on this pic, truecolor actually gets smaller filesizes. However, there is also no need for PNGOUT. All you have to do is export the original image from xnivew (file->export, or ctrl+alt+s) then choose png, set compression to 9 and set filter to "none", this results in a 15.76KB image.
Right... probably not the best image to use as an example.

User avatar
Drahken
Posts: 884
Joined: Sun Apr 10, 2005 4:29 pm

Re: What happened to the adaptive palette?

Post by Drahken » Wed Jul 10, 2013 8:56 am

Interesting, though I don't really want to buy anything else, nor do I want to have to do multiple operations.
The ximagic plugins are free. I think the "purchase" link is just for installing them on multiple computers.
http://www.ximagic.com/q_download.html
Oh the feuhrer, oh the feuhrer, oh the feuhrer's nipples bonk!

User avatar
XnTriq
Moderator & Librarian
Posts: 5456
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: What happened to the adaptive palette?

Post by XnTriq » Wed Jul 10, 2013 7:00 pm

Drahken wrote:
Interesting, though I don't really want to buy anything else, nor do I want to have to do multiple operations.
The ximagic plugins are free. I think the "purchase" link is just for installing them on multiple computers.
http://www.ximagic.com/q_download.html
“The ximagic plugins are shareware now. Does anyone have one of the last freeware versions?”
XnTriq ([url=http://newsgroup.xnview.com/viewtopic.php?p=111320#p111320]Ximagic Adobe Plugins (Denoiser, quantizer, etc)[/url]) wrote:
Beissmich (EFB » [url=http://translate.google.com/translate?sl=auto&tl=en&u=http://www.essential-freebies.de/board/viewtopic.php?p=125795#p125795]Sammelthread Grafik-Plugins[/url]) wrote:Die Plugins von ximagic sind nun Shareware. Hat noch jemand eine der letzten Freewareversionen?

Denoiser 4.6.5 03-Sep-2012
GrayDither 3.6.5 03-Sep-2012
Quantizer 3.6.5 03-Sep-2012
ColorDither 3.6.5 03-Sep-2012
Ximagic (Quantizer » [url=http://www.ximagic.com/q_changelog.html]Changelog[/url]) wrote:v 3.7.0 30-Oct-2012
  • Changed licence to shareware
  • Decreased communication with server
  • SQ- Patched to allow quicker cancellation
  • Win- patched UI code
  • Patch problem in images with size > 30.000

User avatar
Drahken
Posts: 884
Joined: Sun Apr 10, 2005 4:29 pm

Re: What happened to the adaptive palette?

Post by Drahken » Sat Jul 13, 2013 5:15 am

Well that sucks. I really hate it when software makers suddenly change from free to share. Also, the website is very confusing in regards tothe licensing. On one page it says the license is good for 1 installation, on another it says it's good for 2. This discrepancy makes it appear that it's free for a single installation but you pay for multiple.

On the other hand, I do still have some older freeware versions I could upload. The question of course is if the license change is retroactive, making even the old versions shareware now.


EDIT: This abandonware filter works as well (perhaps even better). It's shareware/nagware (has a registration nag when you start the filter and again when you apply it, but works regardless), but the developer is not accepting new registrations & is even considering making them freeware. From the developer's site:
"...Well, we will no longer be selling our software or developing new products. However, the website and all downloads will remain available for all of our loyal customers over the years.
...
Also, it is very possible that I will choose to eventually release at least some of the BoxTop products as freeware. ..."
The filter is ImageVice, downloadable here: http://www.boxtopsoft.com/download.html It gets excellent results. I reduced the sample pic to 16 colors, and it looks very nearly the same as the original: http://allspark.net/cypherswipe/adaptive-color-5.png

To use it, just click anywhere on the first screen that appears to make it go away, then choose 16 colors from the dropdown (or type 16 (or any other number you want to reduce it to) in the field. In the demo above I set all the options to 0, though other settings might work better for other images.
Oh the feuhrer, oh the feuhrer, oh the feuhrer's nipples bonk!

eL_PuSHeR
Posts: 267
Joined: Sat Apr 25, 2009 9:23 am

Re: What happened to the adaptive palette?

Post by eL_PuSHeR » Sat Jul 13, 2013 9:08 am

Older Ximagic plugins work just fine.
Intel i7 5960X
Gigabye GA-X99-Gaming 5
8 GB DDR4 (2100)
GeForce GTX 970 (Gigabyte)

User avatar
Drahken
Posts: 884
Joined: Sun Apr 10, 2005 4:29 pm

Re: What happened to the adaptive palette?

Post by Drahken » Sat Jul 13, 2013 10:01 am

It's not about whether or not they work (I know they work, since I still use them). The issue is availability & legality. For those of us who got them while they were still the "current" versions there's no issue, but for those who don't already have them it's a grey area.
Oh the feuhrer, oh the feuhrer, oh the feuhrer's nipples bonk!

Post Reply