How to apply/attach a colormap from an image to another image

Matteo matteo.niccoli at gmail.com
Thu Jan 28 11:39:28 EST 2016


I've added a quick example to show where I am at. I would like to display 
the second image with the colors of the first one.
Matteo

On Thursday, January 28, 2016 at 9:14:32 AM UTC-7, Matteo wrote:
>
> Can something like this (which by the way I can't get to work) be done 
> using scikit-image?
>
> http://stackoverflow.com/questions/3114925/pil-convert-rgb-image-to-a-specific-8-bit-palette
>
>
> I've done similar things in Matlab before:
>
> https://mycarta.wordpress.com/2012/04/05/visualization-tips-for-geoscientists-matlab-part-ii/
> but I'd really like to be able to do it in Python.
>
>
> What I would like to do currently is:
> 1) Import an RGB image, which would have its own colormap - say this one
> for example:
>
> https://upload.wikimedia.org/wikipedia/commons/b/b3/Jupiter_new_hubble_view_above_pole.png
>
> 2) convert it to intensity, say like this:
>
> intnst = 0.2989 * rgb[:,0] + 0.5870 * rgb[:,1] + 0.1140 * rgb[:,2] # get the intensityintensity = np.rint(intnst) # rounds up to nearest integer
>
>
>  
> 3) display the intensity color-mapped to the same colours the original 
> RGB had.
>
> Any tips, ideally withrcode or pseudocode would be greatly appreciated.
>
> Thanks,
> Matteo
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20160128/2d41af01/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: example.PNG
Type: image/png
Size: 441062 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20160128/2d41af01/attachment.png>


More information about the scikit-image mailing list