Opened 9 years ago

Closed 5 years ago

#2597 closed enhancement (fixed)

[raster] St_Grayscale

Reported by: nclay Owned by: Bborie Park
Priority: medium Milestone: PostGIS 2.5.0
Component: raster Version: master
Keywords: Cc:

Description (last modified by Bborie Park)

Returns a single band 8BUI representation of a RGB raster.

Change History (7)

comment:1 by nclay, 9 years ago

Component: postgisraster
Owner: changed from pramsey to Bborie Park

comment:2 by robe, 6 years ago

Milestone: PostGIS FuturePostGIS Fund Me

Milestone renamed

comment:3 by Bborie Park, 5 years ago

Description: modified (diff)

This can be written as a set of MapAlgebra callback functions (one per particular algorithm) and a ST_Grayscale user (wrapper) function.

Basic implementation should just use the following:

Y = 0.2989 * R + 0.5870 * G + 0.1140 * B

Map Algebra callback function

ST_Grayscale4ma(double precision[][][] value, integer[][] pos, text[] VARIADIC userargs)

User function

ST_Grayscale(raster rast, integer redband=1, integer blueband=2, integer greenband=3)

Bands provided should be preprocessed before grayscaling to make sure input pixel types are 8BUI (via ST_Reclass if necessary)

comment:4 by Bborie Park, 5 years ago

Status: newassigned

comment:5 by Bborie Park, 5 years ago

Milestone: PostGIS Fund MePostGIS 2.5.0

comment:6 by Bborie Park, 5 years ago

comment:7 by Bborie Park, 5 years ago

Resolution: fixed
Status: assignedclosed

Done as of r16207

Note: See TracTickets for help on using tickets.