GeoServer
  1. GeoServer
  2. GEOS-2584

Allow choice of color reduction algorithm for png8 images

    Details

    • Type: New Feature New Feature
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 1.7.0-RC4
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      1

      Description

      Allow the user to choose a more expensive, but alpha preseving color reduction algorithm when generating png8 images

      See therad on the ml for details:
      http://www.nabble.com/What%27s-up-with-the-front-page-map--td21531395.html

        Activity

        Hide
        Andrea Aime added a comment -

        Simone, you shared some palette generation code in google code right? What's the link?
        Does that contain any usage of the neuquant algorithm shipped along with jai?

        Show
        Andrea Aime added a comment - Simone, you shared some palette generation code in google code right? What's the link? Does that contain any usage of the neuquant algorithm shipped along with jai?
        Show
        Simone Giannecchini added a comment - http://code.google.com/p/color-reduction-experiments/
        Hide
        Simone Giannecchini added a comment -

        it should test most of them. I am of course open to create new algorithms or to use third party APIs.

        Show
        Simone Giannecchini added a comment - it should test most of them. I am of course open to create new algorithms or to use third party APIs.
        Hide
        Justin Deoliveira added a comment -

        Made the issue title a bit less verbose

        Show
        Justin Deoliveira added a comment - Made the issue title a bit less verbose
        Hide
        Andrea Aime added a comment -

        It seems this time I tried to bite more than I could chew.

        Ok, so a little more research shows that:

        • the original java neuquant algorithm does not deal with alpha channel in the generated palette
        • the palette inverter code does not deal with alpha either

        The code in the pngnq project deals with alpha, but has been severely reworked and thus requires some understanding of how the neural network works.
        Finally both old and new Neuquant code assumes the image pixels are available in a flat array, and the code extracting it is definitely not memory efficient.

        So I believe I'm going to put this on the back burner and try to solve one problem at a time, reading and understanding the neuquant article, adding proper unit testing around the code back ported from C (or I can take the Java code and pimp it up to 4 dims, but nevertheless, that requires time).

        Show
        Andrea Aime added a comment - It seems this time I tried to bite more than I could chew. Ok, so a little more research shows that: the original java neuquant algorithm does not deal with alpha channel in the generated palette the palette inverter code does not deal with alpha either The code in the pngnq project deals with alpha, but has been severely reworked and thus requires some understanding of how the neural network works. Finally both old and new Neuquant code assumes the image pixels are available in a flat array, and the code extracting it is definitely not memory efficient. So I believe I'm going to put this on the back burner and try to solve one problem at a time, reading and understanding the neuquant article, adding proper unit testing around the code back ported from C (or I can take the Java code and pimp it up to 4 dims, but nevertheless, that requires time).
        Hide
        Andrea Aime added a comment -

        For the sake of keeping the history here is a output format I did some time ago, that dumps a png to file, runs pngnq on it, and returns the results. It's damn slow, result look very nice, and the palette does not really seem to work ok with alpha channel in.

        Show
        Andrea Aime added a comment - For the sake of keeping the history here is a output format I did some time ago, that dumps a png to file, runs pngnq on it, and returns the results. It's damn slow, result look very nice, and the palette does not really seem to work ok with alpha channel in.
        Hide
        Andrea Aime added a comment -

        Superceded by GEOS-4919

        Show
        Andrea Aime added a comment - Superceded by GEOS-4919
        Hide
        Andrea Aime added a comment -

        Switching all issues that have been in "resolved" state for more than one month without further comments to "closed" status

        Show
        Andrea Aime added a comment - Switching all issues that have been in "resolved" state for more than one month without further comments to "closed" status

          People

          • Assignee:
            Andrea Aime
            Reporter:
            Andrea Aime
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: