lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Smiley (JIRA)" <>
Subject [jira] [Commented] (SOLR-8197) Make zero counts in heatmap PNG transparent
Date Fri, 08 Dec 2017 18:18:00 GMT


David Smiley commented on SOLR-8197:

I completely overlooked this issue; sorry about that.

I'm not so sure we should do this.

Firstly, the PNG format here was purely intended for it's compression, not for final rendering.
 One example of why it's poor to render directly is that values in excess of 16M will start
to fade the image due to the abuse of the alpha channel in order to shove an integer into
a RGBA.  Secondly, note that that Solr doesn't offer any ways to make this image pretty (e.g.
apply a readable color scale) whatsoever (the assumption is the client will do that).    I
am curious about your real-world experience rendering it; can you share your experience? 
Do you consume this data from a web client?

Secondly, this is a back-compat break.  It could be addressed but it's awkward.

Thirdly, your patch maps 0 to 0 but I'm guessing this means the integer count value that currently
maps to 0 (16M?) is lost.  We could fix that though.

At some point I'd love to add a new format -- [UTFGrid|]

> Make zero counts in heatmap PNG transparent
> -------------------------------------------
>                 Key: SOLR-8197
>                 URL:
>             Project: Solr
>          Issue Type: Improvement
>          Components: spatial
>            Reporter: Neil Ireson
>            Priority: Minor
>         Attachments: transparency.patch
> It would be useful to have transparent zero values so that I can overlay the image as
a layer on a map.
> The change just requires altering two methods in as follows:
> {code}
> static void writeCountAtColumnRow(BufferedImage image, int rows, int c, int r, int val)
> {
>       image.setRGB(c, rows - 1 - r, val == 0 ? 0 : val ^ 0xFF_00_00_00);
> }
> static int getCountAtColumnRow(BufferedImage image, int rows, int c, int r)
> {
>       int val = image.getRGB(c, rows - 1 - r);
>       return val == 0 ? 0 : val ^ 0xFF_00_00_00;
> }
> {code}

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message