Ximagic Quantizer

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

Moderators: XnTriq, xnview

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

Re: Ximagic Quantizer

Post by eL_PuSHeR » Wed May 06, 2009 1:02 pm

The pattern is loaded fine but I always get the same numbers for width, height, divisor and the results are very bad. I am posting an example using a pattern loaded from the 8x8ort.png from the examples page.

My, my. At work's computer I am getting a very bad output. Here (at my home's pc), the pattern is loaded fine from file but the plugin seems to have crashed.

Definitely, it isn't working as intended. Here is what I get after loading the plugin:

Image

And, after executing it, I get just a white rectangle.
Intel i7 5960X
Gigabye GA-X99-Gaming 5
8 GB DDR4 (2100)
GeForce GTX 970 (Gigabyte)

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

Re: Ximagic Quantizer

Post by brodriguez » Wed May 06, 2009 2:13 pm

It is clearly a bug in the instructions plus a confusing UI :(

The "load from image" refers to the image actually selected in the editor, it its not loaded from a file.

From the screenshot you send, it seems you try to load the main image as a threshold. The width and height should be 8 if you load the "half8x8o.png" threshold image and you get a 2136 x 3216 user threshold.

To load a pattern from an image you must select the threshold image (half8x8o.png) as the selected image in the editor before you start the plugin, then load this image as threshold, and finally close the plugin to select another image (to which you want to apply the dither)

There are two things in the UI which could be confusing, so I published another version (1.21) with the following changes.

1.- The input field "File" should be disabled when the radio button "From actual image" is selected.
2.- After the threshold pattern image was loaded, it don't make sense to apply it to itself, and the user can't select another image without ending the plugin.So the plugin will automatically end to allow to select another image in the editor.

I hope now it works :?:

It will be more intuitive to load the image from a file, but there is a reason to do things this way.
To load an image from a file, the plugin should use an external library instead of the image editor to get the image.
Adding another library, to do something the image editor could do seems a very bad idea. :(

Regards

PS last version 1.22. Due to windows registry limits, the threshold size could not be greater than 262144 (width*height)
Last edited by brodriguez on Wed May 06, 2009 6:27 pm, edited 2 times in total.

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

Re: Ximagic Quantizer

Post by eL_PuSHeR » Wed May 06, 2009 3:10 pm

Thank you very much for the clarification and good work. I will try it later.

BTW: Is there any algorithm or math formula to easily create orthogonal filters? I am tryin to draw a 10x10ort filter but I suck at drawing.
Intel i7 5960X
Gigabye GA-X99-Gaming 5
8 GB DDR4 (2100)
GeForce GTX 970 (Gigabyte)

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

Re: Ximagic Quantizer

Post by brodriguez » Thu May 07, 2009 1:44 pm

I don't found such algorithm except in patents. :(

Anyway I make some test to generate patterns by program. :)

I tested several simple methods and finally select 4 samples of halftone 10x10 (ort)

halftone10x10o_a2

Code: Select all

10 10
  6   17   31   40   48   41   34   20    9    2  
 16   36   55   63   69   66   58   43   22    7  
 30   54   70   81   85   82   75   60   37   14  
 39   62   80   92   96   93   86   71   49   24  
 47   68   84   95  100   98   90   77   56   28  
 42   67   83   94   99   97   88   73   52   26  
 35   59   76   87   91   89   79   64   45   18  
 21   44   61   72   78   74   65   51   32   11  
 10   23   38   50   57   53   46   33   13    4  
  3    8   15   25   29   27   19   12    5    1  
halftone10x10o_a4

Code: Select all

 10 10
  4   12   21   34   42   37   29   17    9    2  
 11   26   48   56   67   64   53   45   22    7  
 20   47   68   76   84   81   73   62   43   15  
 33   55   75   88   96   93   86   71   51   27  
 41   66   83   95  100   98   91   79   60   35  
 38   65   82   94   99   97   89   77   58   31  
 30   54   74   87   92   90   85   69   49   24  
 18   46   63   72   80   78   70   57   39   13  
 10   23   44   52   61   59   50   40   19    5  
  3    8   16   28   36   32   25   14    6    1 
halftone10x10o_a5

Code: Select all

 10 10
  1    6   14   26   34   35   27   15    7    2  
  5   21   42   50   59   60   51   43   22    8  
 13   41   58   70   78   79   71   61   44   16  
 25   49   69   85   90   91   86   72   52   28  
 33   57   77   89   97   98   92   80   62   36  
 40   68   84   96  100   99   93   81   63   37  
 32   56   76   88   95   94   87   73   53   29  
 20   48   67   75   83   82   74   64   45   17  
 12   24   47   55   66   65   54   46   23    9  
  4   11   19   31   39   38   30   18   10    3  
halftone10x10o_b

Code: Select all

 10 10
  3   11   19   31   39   38   30   18   10    2  
  7   23   47   55   67   66   54   46   22    6  
 15   43   63   75   83   82   74   62   42   14  
 27   51   71   87   95   94   86   70   50   26  
 35   59   79   91   99   98   90   78   58   34  
 36   60   80   92  100   97   89   77   57   33  
 28   52   72   88   96   93   85   69   49   25  
 16   44   64   76   84   81   73   61   41   13  
  8   24   48   56   68   65   53   45   21    5  
  4   12   20   32   40   37   29   17    9    1  
If you test it, please me tell me how it works. I can test it on the monitor, but I'm sure you will be a better tester for the print quality. :wink:
If the method works I'll add the option of calculated threshold to the program. The method allows also eliptical dots but don't allow rotations.

Regards

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

Re: Ximagic Quantizer

Post by eL_PuSHeR » Thu May 07, 2009 7:36 pm

I have printed Eva Wyrwa sample four times using each one of the filters you posted. Thank you very much, by the way.

A2 and A5 has a somewhat grainy appearance. A5 and B have very similar look and are fine, as quality is concerned.

I have made several more tests using that GIMP plugin and I have noticed that a ort 12x12 dither is the best for my 1200dpi laserjet (at 100 LPI). Your 16x16-o is very sweet too, but with a mesh that big, you notice the grid.

Comparing outputs from your 10x10o-b filter with the GIMP one, I noticed very little differences, both in visual and quality.

Regards.
Intel i7 5960X
Gigabye GA-X99-Gaming 5
8 GB DDR4 (2100)
GeForce GTX 970 (Gigabyte)

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

Re: Ximagic Quantizer

Post by brodriguez » Thu May 07, 2009 11:29 pm

el_PusHEer wrote:A2 and A5 has a somewhat grainy appearance. A5 and B have very similar look and are fine, as quality is concerned.
I suppose the first A5 is A4. Both A2 and A4 are excentric circles and A5 and B are centered. I discover that circle clusters tend to be connected when the circle is centered (as in A5 and B).
el_PusHEer wrote:I have made several more tests using that GIMP plugin and I have noticed that a ort 12x12 dither is the best for my 1200dpi laserjet (at 100 LPI). Your 16x16-o is very sweet too, but with a mesh that big, you notice the grid.
Unfortunately The GIMP is under GPL license and I can't use code (or ideas) from it. I have to develop and code from zero. :(

Anyway, as the results seems good enough I'll add the code for calculated pattern inmediately to the plugin. You will have the 12x12 in minutes :)
el_PusHEer wrote:Comparing outputs from your 10x10o-b filter with the GIMP one, I noticed very little differences, both in visual and quality.
Great 8)

Initially I'll add only the ortogonal patterns without rotations, but allowing different shapes as in the GIMP.
And it will have one thing that the GIMP doesn't, color posterization, the newspaper filter only produce two levels for each channel.
Multilevel dithering is not usable for your purposes since you only want B/W output.

Regards

PS I've published v 2.20 with support for the calculated halftone, although with only circle shape and without rotations, now you have the 12x12 ort pattern. :)

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

Re: Ximagic Quantizer

Post by eL_PuSHeR » Fri May 08, 2009 6:39 am

Thank you very much. I am going to test it.

Heh, so many tests are driving me insane, but it's cool. :mrgreen:

Comparing results (with the GIMP plugin again):

A) The grid in your 12x12 generated filter is more noticeable to the eye than in the 12x12 GIMP one I used. I guess it's because the different patterns used. Your filter uses circles and in the GIMP plugin I used Euclidean points (if memory serves me well).

b) On the other hand, the overall quality for your plugin is better than its GIMP "counterpart". Contrast is better and the output grayscale is more accurate, when compared to the original image colours/grayscale values. I think the colour-reduction/selection in your plugin is more consistent.

Keep up the good work.

Best regards.
Intel i7 5960X
Gigabye GA-X99-Gaming 5
8 GB DDR4 (2100)
GeForce GTX 970 (Gigabyte)

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

Re: Ximagic Quantizer

Post by brodriguez » Sun May 10, 2009 12:12 pm

eL_PuSHeR wrote:Heh, so many tests are driving me insane, but it's cool. :mrgreen:
You don't know how difficult is to find someone willing to test and comment :wink:

I've been testing several algorithms to calculate the screens and I've included 5 of it in the calculated options, named Circle A to Circle E. (v 2.21)

Apparently C and E are the best ones, but I depend on your comments, I don't have a monochrome laser to test it.

I also created 5 grayscale grids for dither testing and put in a new Quantizer samples page.

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

Re: Ximagic Quantizer

Post by eL_PuSHeR » Sun May 10, 2009 12:56 pm

I have to check a friends PC at 5 o'clock, but as soon as I return home, I am going to do some more testing.

I'll keep you posted.

EDIT: I was able to do one test before leaving.

When printing Eva Wyrwa image to 1200dpi (12x12 grid - 100LPI), I have seen that:

*** TEST PENDING, because I have found a bug in the Plugin GUI ***

I had choose the grid size by manually typing the numbers. It seems this doesn't work well. You have to use the mouse and click on the button arrows.

My results, printing Eva Wyrwa sample at 1200dpi (16x16 cell -100 LPI)

- A & C methods produce coarser output (and little darker too).

- B & D methods produce smoother and lighter output (so far, my favourite is B).

- E method is quite similar to B & D, although a tad darker. Quality is similar.
Intel i7 5960X
Gigabye GA-X99-Gaming 5
8 GB DDR4 (2100)
GeForce GTX 970 (Gigabyte)

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

Re: Ximagic Quantizer

Post by brodriguez » Sun May 10, 2009 2:28 pm

eL_PuSHeR wrote:*** TEST PENDING, because I have found a bug in the Plugin GUI ***

I had choose the grid size by manually typing the numbers. It seems this doesn't work well. You have to use the mouse and click on the button arrows.
Oh yes, the manual input should not be allowed, corrected in (v 2.22) :(

I've also found a bug in DBS, it crash the plugin, I'm analyzing it.

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

Re: Ximagic Quantizer

Post by eL_PuSHeR » Sun May 10, 2009 6:29 pm

More tests:

When printing the image below. A typical manga image with only 15 colours and lots of solid-areas, I haven't noticed that much of a difference among the five different methods (A-E).

Image

Image printed at 8cm wide at 600 dpi, using a 6x6 grid. Using 45º ort 6x6 Ulichney gives a slightly better output but also blurrier.

And now that I hadn't noticed the 45º Ulichney filters I printed Eva Wyrwa at 1200dpi (using 8x8 and 16x16 grids).

- 8x8 looked like crap. Too much contrast.
- 16x16 looks pretty and almost identical as printing using Postscript with my Windows driver. I don't know why (the angle?), but 16x16 45º is much more smoother that 16x16-o (90º), which is coarser. Why? is that due to the angles used?

I HAVE SEVERAL SUGGESTIONS:

1. Make the downloadable plugin a ZIP file.
2. Change name of ordered diffussion filters to "Dispersed (Bayer) 2x2" and so on.
3. Group ordered filters in two categories: dispersed and clustered.
Intel i7 5960X
Gigabye GA-X99-Gaming 5
8 GB DDR4 (2100)
GeForce GTX 970 (Gigabyte)

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

Re: Ximagic Quantizer

Post by brodriguez » Mon May 11, 2009 12:46 am

eL_PuSHeR wrote:I don't know why (the angle?), but 16x16 45º is much more smoother that 16x16-o (90º), which is coarser. Why? is that due to the angles used?
The sizes NxN are the ones of the threshold matrices, not the dot(cluster) size.

The threshold matrices for 45 patterns includes two dots along a 45º line, while the 90º (ort) includes 1.

For 16x16 matrices, the diameter of circular dot in "16x16 ort" is 16, but in "16x16 45º" it is 11,314 = sqrt( (16/2)^2 + (16/2)^2)

The confusion comes from the use of precalculated threshold matrices.

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

Re: Ximagic Quantizer

Post by eL_PuSHeR » Mon May 11, 2009 7:04 am

Thanks for the explanation.

In the end, everything has to do with maths, which I usually suck at. :D

PS - It's true that the DBS code now hangs when used. Using PSP10, I get some kind of error at the script output window.
Intel i7 5960X
Gigabye GA-X99-Gaming 5
8 GB DDR4 (2100)
GeForce GTX 970 (Gigabyte)

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

Re: Ximagic Quantizer

Post by brodriguez » Wed May 13, 2009 1:16 am

eL_PuSHeR wrote:2. Change name of ordered diffussion filters to "Dispersed (Bayer) 2x2" and so on.
3. Group ordered filters in two categories: dispersed and clustered.
Agree, it must be some kind of separation between the clustered and dispersed dot.

I'm now reworking the plugin as two different plugins, the color one and the grayscale one. I think now the plugin it is a bit confusing. :(

After I've finished, I'll change the ordered dithering interface, to something more clear and rework the color ordered dithering which must be different to the gray one.

I expect I'll finish the split tomorrow.

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

Re: Ximagic Quantizer

Post by eL_PuSHeR » Wed May 13, 2009 6:21 am

Don't tax yourself too much working. :wink:
Intel i7 5960X
Gigabye GA-X99-Gaming 5
8 GB DDR4 (2100)
GeForce GTX 970 (Gigabyte)

Post Reply