[ 
https://issues.apache.org/jira/browse/SOLR-8197?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16283968#comment-16283968
 ] 

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|https://github.com/mapbox/utfgrid-spec]

> Make zero counts in heatmap PNG transparent
> -------------------------------------------
>
>                 Key: SOLR-8197
>                 URL: https://issues.apache.org/jira/browse/SOLR-8197
>             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 SpatialHeatmapFacets.java 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
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to