Ximagic Quantizer

All non-XnView related: softwares, formats, imaging, photography...

Moderators: XnTriq, helmut, xnview

brodriguez
Posts: 64
Joined: Sun Feb 01, 2009 2:15 am

Ximagic Quantizer

Post by brodriguez »

  • <-- Moderator's note: This topic has been split off from the thread “Scolorq dithering?”. -->
You can find a free photoshop plugin which includes scolorq and is compatible with XNView in
http://www.ximagic.com
User avatar
NM64
Posts: 79
Joined: Sun Aug 05, 2007 7:17 pm

Post by NM64 »

YOU. ARE. AWESOME. *gives 9000+ internets*

That plugin should be included in XnView by default.
Last edited by NM64 on Thu May 07, 2009 7:51 pm, edited 1 time in total.
User avatar
XnTriq
Moderator & Librarian
Posts: 6388
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: SColorQ free photoshop plugin

Post by XnTriq »

brodriguez wrote:You can find a free photoshop plugin which includes scolorq and is compatible with XNView in
http://www.ximagic.com
¡Muchas gracias, brodriguez! :D
Blas Rodriguez Somoza ([url=http://www.ximagic.com/index.html]Ximagic Quantizer[/url]) wrote:Ximage Quantizer is a photoshop plugin for image color quantization (color reduction) & dithering.
  • Provides 10 color quantization methods.
  • Provides 11 dithering methods.
  • Calculates RMSE of the transformation.
  • Allow choice of colorspace RGB or YCbCr
  • Can be also used in other compatible plugin hosts (The Gimp, Irfanview, Xnview, Photo paint ....)
  • Allow you to apply the algorithm to the selected portion of the image and not only to the full image.
  • Important: It reduces the number of colors in a image, but don't change a RGB image to indexed color. If you want to use it to change an image from RGB to index color, you should use your image tool to change the image mode, after running XImagic quantizer.
Besides its practical use, this plug-in is also a great learning tool.

Forum references:
Last edited by XnTriq on Thu Feb 05, 2009 5:15 am, edited 1 time in total.
User avatar
NM64
Posts: 79
Joined: Sun Aug 05, 2007 7:17 pm

Post by NM64 »

Also by using it, you can get to color amounts that are less than 16 and those that aren't powers of 2.

Oh, and I've found a bug... I don't know if it's with the way XnView handles plugins or the actual plugin itself, but here's test.

Take this image and put the XnView zoom level at 100%. Now in the plugin, do a Scolorq conversion @ 16 colors | Filter: 3 | Dithering: 10

Ignore the message and wait a bit as your CPU crunches away. (we could really use some OpenCL support for that...)

Now open the original image again, but set XnView's zoom to 150%. Do the same Scolorq conversion as the last one with the same settings and all.

Notice that the blue background is of considerably lower quality in the 2nd one. But this was only a zoomed image, not resized. So why did the results come out so different?
Last edited by NM64 on Wed Feb 04, 2009 2:21 am, edited 1 time in total.
User avatar
XnTriq
Moderator & Librarian
Posts: 6388
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Post by XnTriq »

Hi nintendomaniac64,

it seems as if Ximagic Quantizer's implementation of SColorQ produces different results no matter what plug-in host or zoom level is used. :bugconfirmed:
  • Image
    pnggrad8rgb.png | Photoshop v6.0.1 | Colors: 16 | Filter size: 3 | Dith. Level * 100: 10
User avatar
NM64
Posts: 79
Joined: Sun Aug 05, 2007 7:17 pm

Post by NM64 »

I already know that, but even that results in very similar quality images in comparison to what I'm talking about.

Lemme dig through my recycle bin and get some examples to show you what I mean.

Alright, here's 3 images I converted using the settings I stated in my last post @ 100% zoom.

Image Image Image

As you can see, the results are very similar.


Now here's one using the same settings, but the image was zoomed 150%:

Image

Oh jeebus, that certainly can't be right!
brodriguez
Posts: 64
Joined: Sun Feb 01, 2009 2:15 am

Post by brodriguez »

Thanks both for your comments.

This plugin tries to be a learning as well as working tool and this is the reason it includes not only the best methods, but all those that could be of interest.

Let me try to help with the two questions I found

XnTriq - About getting the same results from two runs.

SColorQ uses random numbers to fill the initial palette, which is very important for the result. As a consecuence the results are diferent in each run. The random seed used is a second clock which means the results are similar when you make two runs very near in time.

In quantization methods, there is very common to start with an initial random palette. Older methods such as Octree, medians and olders ones don't need this approach.

nintendomaniac64 - Zoom in XNView.

By default XNView (at least mine) comes with high quality zoom selected only for reductions and apparently SColorQ produced images work badly with the low quality zoom, I've also surprised with that.

Go to Tools->Options->View->High Quality Zoom and check if Enlarge is marked.

------------------

I hope this helps.

It will an update of the plugin available today, with some code optimizations in the scolorq algorithm, which reduces the time 35% more or less.

If you know any other quantization o dithering algorithm which should be included, please let me know.
User avatar
NM64
Posts: 79
Joined: Sun Aug 05, 2007 7:17 pm

Post by NM64 »

Indeed, HQ zoom was off. But still, this is only ZOOM, not resize - it shouldn't have any effect on image processing!
brodriguez
Posts: 64
Joined: Sun Feb 01, 2009 2:15 am

Post by brodriguez »

I suspect from the tests I made with your image, that the zoom is only a coincidence. As you say, there is no difference in the data and could not affect the image processing.

The initial palette problem is even more serious than I think, at least with your image. In one of the tests, I get an image with the windows logo in only one color.

I'll try to test the method with not random initial palettes and if it works I'll add a option to choose the initial palette generation method.

I'll post a message with the results ASAP.
User avatar
XnTriq
Moderator & Librarian
Posts: 6388
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Post by XnTriq »

brodriguez wrote:This plugin tries to be a learning as well as working tool and this is the reason it includes not only the best methods, but all those that could be of interest.

Let me try to help with the two questions I found

XnTriq - About getting the same results from two runs.

SColorQ uses random numbers to fill the initial palette, which is very important for the result. As a consecuence the results are diferent in each run. The random seed used is a second clock which means the results are similar when you make two runs very near in time.

In quantization methods, there is very common to start with an initial random palette. Older methods such as Octree, medians and olders ones don't need this approach.
Thanks for your explanations. Playing with Ximagic Quantizer has already taught me a thing or two 8)
Moonflare (Spatial Color Quantization » [url=http://www.moonflare.com/code/scolorq/index.php#usingunderwindows]Using under Windows with Photoshop[/url]) wrote:Update: As of February 2009, scolorq has been incorporated by Blas Rodriguez Somoza into a Photoshop plug-in called Ximagic Quantizer, which I recommend using with Photoshop or the GIMP on Windows.
User avatar
Drahken
Posts: 884
Joined: Sun Apr 10, 2005 4:29 pm

Post by Drahken »

One very frustrating thing with this plugin (especially when trying to test 7 compare different options) is that it refuses to remember any settings from one use to the next.
brodriguez
Posts: 64
Joined: Sun Feb 01, 2009 2:15 am

Post by brodriguez »

Most photoshop filters store the parameter values between runs using a service from the plugin host. Xnview, IrfanView or GIMP don't have this service.

Some photoshop plugins, f.i. Harry's filters, store the values apparently bypassing photoshop. I'll try to add this function in the future.
User avatar
Drahken
Posts: 884
Joined: Sun Apr 10, 2005 4:29 pm

Post by Drahken »

I thought it might just be an xnview thing at first, but I also tried it in paint shop pro before posting that last message. All other photoshop plugins I have remember their setting when I use them in psp, even though some of those same plugins don't remember when I use them in xnview.
User avatar
NM64
Posts: 79
Joined: Sun Aug 05, 2007 7:17 pm

Post by NM64 »

I tested this plugin on a quad-core PC hoping to see some uber-speed processing and I was dissapointed at the lack of efficient multi-core scaling. I don't know exactly how long it took, but I'm pretty sure it was still over 30 seconds or so. (now we could REALLY use some OpenCL :P)

Same image and settings as before.

Image
brodriguez
Posts: 64
Joined: Sun Feb 01, 2009 2:15 am

Post by brodriguez »

There is a new version of the plugin available (1.3) which reduces scolorq processing time around 50%-40%. Now the random palette changes more quickly and it is easier to find a good looking result.

Also a note was added in the main page about SColorQ random results.

nintendomaniac64: Yes the plugin don't speed up on multicore processors. The work needed to make it use multicore only make some sense on SColorQ since the other methods are quick enough, and SColorQ is not an easy candidate to multicore processing. :(