AuthorTopic: Advanced ProMotion functionality (eg. dither formula)?  (Read 3834 times)

Offline LoTekK

  • 0010
  • *
  • Posts: 215
  • Karma: +1/-0
    • View Profile
    • LoTekK.com

Advanced ProMotion functionality (eg. dither formula)?

on: December 15, 2009, 02:18:05 pm
Has anyone messed with custom dither patterns in ProMotion? I'm wondering if there's a way to get slightly more "organic" (for lack of a better word) dither patterns via custom formulae. Math, however, is not one of my strong suits. I took a quick look at the documentation for the feature, but it's obviously all very math heavy, and there doesn't appear to be a way to randomise the values, since that's kind of what I'm hoping to be able to do. Short of being able to randomise values somewhat, does anyone have custom dither patterns that they find useful that don't look quite so organised? I mean, I know there's manual dithering, and tweaking the dither pattern afterwards, but it'd be nice to be able to define a more organic dither than the defaults currently available.

Offline Ai

  • 0100
  • ***
  • Posts: 1057
  • Karma: +2/-0
  • finti
    • http://pixeljoint.com/pixels/profile.asp?id=1996
    • finticemo
    • View Profile

Re: Advanced ProMotion functionality (eg. dither formula)?

Reply #1 on: December 16, 2009, 01:36:32 am
Has anyone messed with custom dither patterns in ProMotion? I'm wondering if there's a way to get slightly more "organic" (for lack of a better word) dither patterns via custom formulae. Math, however, is not one of my strong suits. I took a quick look at the documentation for the feature, but it's obviously all very math heavy, and there doesn't appear to be a way to randomise the values, since that's kind of what I'm hoping to be able to do. Short of being able to randomise values somewhat, does anyone have custom dither patterns that they find useful that don't look quite so organised? I mean, I know there's manual dithering, and tweaking the dither pattern afterwards, but it'd be nice to be able to define a more organic dither than the defaults currently available.

I have quite a few custom dither matrices. (http://gimpstuff.org/content/show.php/dithering%2Bhalftoning+patterns?content=81817 is a quite small subset -- look at the preview images to see what dither matrices are included there.)

As far as I can see, though, Pro Motion doesn't support any real customization of the dither matrices, which is a shame. It just uses a standard Bayer matrix -- looks like an 8x8 one (which would normally allow for 64 levels, but Pro Motion seems to quantize it to 32 levels, from looking at the screenshot of it). There's not any complex math as far as I can see -- dithering is quite simple mathematically speaking. You have your dither pattern, and the coordinates of the pixel you're dithering. you calculate the remainders of x/pattern_width, y/pattern_height and use them as coordinates into the pattern. You compare the value at that location with the dithering factor. If it's greater than the dithering factor, produce color B (probably transparency), otherwise, produce color A.
If you're just using a single B/W dither pattern (not a dither matrix, which is grayscale), it really just amounts to a mask for applying color.

There are a few guidelines for making good dither matrices:

* No pixel present in a lower level of dithering can be absent from a higher level of dithering
  (this applies only to B/W patterns -- matrices automatically fulfill this criteria)
* as dithering saturation increases, each subsequent pixel filled should be maximally distant from previous pixels,
  even measuring across borders.
  (this is why Bayer matrixes are so often used)
* make sure it tiles well! (heh)

I notice though that it says "Below the dither slider you can set up different dither patterns for quick selection."
so maybe there is customization available.  As I've not used Pro Motion in a while, I don't know how that 'setting up' works.

If you want to request better customization of dithering, I suggest 32x32 is a good dither matrix size. You often will only need 4x4, but larger matrices will be needed to achieve more organic dithering.
If you insist on being pessimistic about your own abilities, consider also being pessimistic about the accuracy of that pessimistic judgement.

Offline ptoing

  • 0101
  • ****
  • Posts: 3063
  • Karma: +0/-0
  • variegated quadrangle arranger
    • the_ptoing
    • http://pixeljoint.com/p/2191.htm
    • View Profile
    • Perpetually inactive website

Re: Advanced ProMotion functionality (eg. dither formula)?

Reply #2 on: December 16, 2009, 01:40:45 am
Promotion uses a 16x16 matrix. 256 levels of dither if you want to.

Here are all 256 16x16 blocks in one image.


Obviously after 128 or 50% dither it basically just inverts.

Why anyone who is pixelling would need more than this or a 32x32 matrix I don't know.
As soon as you got a human being at the end of a mouse, tablet, trackball, whatever the fuck they are pixelling with, they can fiddle the dither into whatever shape and form they need it to be, including interleaving colours and what not.

If you want to colour reduce photos obviously the matrix should be bigger, but for pixelart most of the time I personally just use 25, 50 and 75 percent dithers and then edit the rest by hand as needed.
« Last Edit: December 16, 2009, 02:07:30 am by ptoing »
There are no ugly colours, only ugly combinations of colours.

Offline LoTekK

  • 0010
  • *
  • Posts: 215
  • Karma: +1/-0
    • View Profile
    • LoTekK.com

Re: Advanced ProMotion functionality (eg. dither formula)?

Reply #3 on: December 16, 2009, 03:32:50 am
Cheers, Ai, those are pretty neat. Looks like I'll have to do a bit of digesting this evening. :)

ptoing, I guess my main aim in asking was more of a productivity question than anything; less to do with regular gradients/transitioning, and more with getting a first-pass irregular dither pattern fill to tweak (say, to initially define a rough, irregular surface). You're right, though; in most cases the standard dither patterns work perfectly well with a bit of hand editing.