libvips / libvips/php-vips

Color Quantization

Open
#256 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
721
Forks
33
PR merge metrics
No merged PRs in 30d

Description

Is it possible in any way to reduce the distinct colors in an image with the result being visually similar as possible to the original?

I have found out that I can achieve this by setting the palette and bitdepth parameters when encoding to PNG format.

The question I am asking myself is whether this is also possible outside or before the encoding process and without committing to a certain image format. And if this is the case, is it also possible to reduce to any number of colors instead of fixed bit depths?

Thanks in advance.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue does not name any files, tests, or entry points. Begin by reviewing how PNG palette and bitdepth parameters are exposed, then determine whether format-independent quantization and arbitrary color counts fit the binding; done would require an agreed API and documented behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
computer-graphics
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.