Skip to content

Better color detail via other colorspaces (e.g. YDbDr) #128

@mia-0

Description

@mia-0

I was trying a few things to get better results and found out transforming to YDbDr (which encodes blue/red chroma as the difference to luma), quantizing and remapping, then transforming back to sRGB preserves more color detail especially when requesting very low color counts.

Here are some of my 16-color results, which I obtained by using ImageMagick’s API to transform to YDbDr, passing it through libimagequant as if it were RGB, and reversing the color transformation.

original unmodified via YDbDr
original Image Image
Image Image Image
Image Image Image
Image Image Image

Of course this doesn’t always yield pretty results:

original unmodified via YDbDr
Image Image Image

However, there’s one more trick we can use in special cases: sigmoidal contrast adjustment before and after quantization (I did that in Oklch colorspace for this example).

unmodified via YDbDr sigmoidal contrast
Image Image Image

Just leaving this here as inspiration 🙂

With a custom color transform it might be possible to turn it into a color weighting option or something. I also haven’t tried playing with importance maps yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions