Select to view content in your preferred language

colorizing a black and white Imagery Layer

1889
11
03-01-2021 10:53 AM
roch
by
New Contributor

Hello !

I am using the terrain elevation layer wich is black and white but I'd like to give it some color for more user friendly look.

For instance black to blue grey to green and white to red or more steps .. is there a built in library for this ?

thank you

0 Kudos
11 Replies
JohnGrayson
Esri Regular Contributor

Can you please share a simple CodePen showing us what you've tried so far?

0 Kudos
johnbrosowsky
Frequent Contributor
0 Kudos
roch
by
New Contributor

@JohnGrayson well right now I'm gathering informations on how to do this so I have nothing to show. I just made a map with markers yet ...

@JohnGrayson thank you for your answer but , as I understand how blending work from photo editing , It could be part of the answer If I could blend only specific parts of the grayscale one at a time(black to red, gray to green and white to red), wich would also seem very coslty.

 

I want to end up with something like this 

 

roch_1-1614637690196.png

 

0 Kudos
johnbrosowsky
Frequent Contributor
0 Kudos
calimucho
Emerging Contributor

wow ! I did bot now about RasterShadedReliefRenderers, it's really cool thanks 🙂 I think indeed the color ramp is what I was looking for  ! thanks a lot

last question though : colorrange remaps  the grayscale of the whole terrain map to the given colors, is it possible to make the color range refine to a zoomed-in region min and max altitude  ? 

0 Kudos
calimucho
Emerging Contributor

@johnbrosowsky could I not use RasterColorMapRenderer then ? I made this but does not seem to work ... https://codepen.io/ebkgne/pen/mdOLLep

0 Kudos
JohnGrayson
Esri Regular Contributor

The doc says "The RasterColormapRenderer is only available if a color map is present in an ImageryLayer or ImageryTileLayer." but the service you are trying to use doesn't have a color map defined.  Instead, you can use a ClassBreaksRenderer to achieve what you'd like; check out this CodePen: https://codepen.io/john-grayson/pen/RwoJbPq 

0 Kudos
calimucho
Emerging Contributor

@JohnGrayson hey ! well I did not get how classBreakRenerer worked before, I'm learnig a lot on this thread thanks ! Do you think it'd be very costly / overkill to put let say a 100 ClassBreakInfo for a gradient like colorizing ? and alternative question, with the RasterShadedReliefRenderers, would it be less costly (still quite overkill) to play with duplicating first and last values in the MultipartColorRamp to achieve a similar render. hope I made myself clear ... thx !

0 Kudos
JohnGrayson
Esri Regular Contributor

Check out all of the available renderers and yes, maybe the RasterColormapRenderer or RasterShadedReliefRenderer might be better fits for what you need.

0 Kudos