Skip to content

renderPng() returns Png with transparent pixels where there should be black pixels #2572

@kthompson

Description

@kthompson

We are using geotrellis 1.1.1

Here are two code samples that return png's which have the middle(second) row of pixels transparent instead of black:

Example 1 - RGB

val red = ArrayTile(Array(255,0,0, 0,0,0, 255,0,0), 3, 3)
val green = ArrayTile(Array(0,255,0, 0,0,0, 0,255,0), 3, 3)
val blue = ArrayTile(Array(0,0,255, 0,0,0, 0,0,255), 3, 3)

val rgbTile = MultibandTile(red, green, blue).color()

rgbTile.renderPng().write("test.png")

Example 2 - RGBA

val red = ArrayTile(Array(255,0,0, 0,0,0, 255,0,0), 3, 3)
val green = ArrayTile(Array(0,255,0, 0,0,0, 0,255,0), 3, 3)
val blue = ArrayTile(Array(0,0,255, 0,0,0, 0,0,255), 3, 3)
val alpha = ArrayTile(Array(255,255,255, 255,255,255, 255,255,255), 3, 3)

val rgbaTile = MultibandTile(red, green, blue, alpha).color()

rgbaTile.renderPng().write("test.png")

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions