10-22-2017, 04:24 PM
Thanks everybody. Combining everybody's suggestions here with a bunch of experiments got me the result I wanted. Rich2005's advice nearly got me there but I couldn't persuade the "sort palette" tool to do its job correctly. Anyway, I've documented the process this time, so I've added my notes below.
And to illustrate the result:
This image is a NASA solar flare photograph that had to have been colourized with a gradient map because these are captured at one wavelength -- but it's a good choice of colours (warning: 4096x4096 pix):
https://www.nasa.gov/sites/default/files...flare.jpeg
This NASA sunspot image is coloured blue for some reason:
https://www.nasa.gov/sites/default/files..._0131.jpeg
So using the first as a reference, I colorized the second to give:
https://i.imgur.com/yzhK8CG.jpg
Create gradient map from reference image for colourizing other images
---------------------------------------------------------------------
( The reference image should be a greycale image that had itself been
colourized by somebody with a gradient map, so this process is
intended to recreate the gradient map that had been used.)
Load reference image into Gimp.
file -> new -> 1024x64 (new image needs to be this wide for some reason)
view -> snap to canvas edges
foreground colour: black, background colour:white
blend tool -> shape: linear, no dithering, colour: FG to BG (RGB)
drag mouse from bottom left to bottom right of new image
(that gives greyscale gradient from back to white across the image)
colours -> map -> sample colourize:
sample: reference image, destination: greyscale gradient image
get samples, apply
colours -> info -> colourcube analysis
(that shows 265 unique colours, which is the correct number already)
image -> mode -> indexed: optimum palette, 256 colours
windows -> dockable dialogue -> palette
(this dialogue already shows the palette of the indexed-image at the top)
palettes -> right-click "colourmap of image #2" -> palette to gradient
windows -> dockable dialogues -> gradients
gradients -> double-click "colourmap of image #2 -> rename it -> enter
(Done. It's saved as the file ~/.gimp-2.8/gradients/thename.ggr and
can now be used to colourize other images.)
Load image to be colourized into Gimp
gradients dialogue -> select required gradient map
colours -> map -> gradient map.
Done.
And to illustrate the result:
This image is a NASA solar flare photograph that had to have been colourized with a gradient map because these are captured at one wavelength -- but it's a good choice of colours (warning: 4096x4096 pix):
https://www.nasa.gov/sites/default/files...flare.jpeg
This NASA sunspot image is coloured blue for some reason:
https://www.nasa.gov/sites/default/files..._0131.jpeg
So using the first as a reference, I colorized the second to give:
https://i.imgur.com/yzhK8CG.jpg
Create gradient map from reference image for colourizing other images
---------------------------------------------------------------------
( The reference image should be a greycale image that had itself been
colourized by somebody with a gradient map, so this process is
intended to recreate the gradient map that had been used.)
Load reference image into Gimp.
file -> new -> 1024x64 (new image needs to be this wide for some reason)
view -> snap to canvas edges
foreground colour: black, background colour:white
blend tool -> shape: linear, no dithering, colour: FG to BG (RGB)
drag mouse from bottom left to bottom right of new image
(that gives greyscale gradient from back to white across the image)
colours -> map -> sample colourize:
sample: reference image, destination: greyscale gradient image
get samples, apply
colours -> info -> colourcube analysis
(that shows 265 unique colours, which is the correct number already)
image -> mode -> indexed: optimum palette, 256 colours
windows -> dockable dialogue -> palette
(this dialogue already shows the palette of the indexed-image at the top)
palettes -> right-click "colourmap of image #2" -> palette to gradient
windows -> dockable dialogues -> gradients
gradients -> double-click "colourmap of image #2 -> rename it -> enter
(Done. It's saved as the file ~/.gimp-2.8/gradients/thename.ggr and
can now be used to colourize other images.)
Load image to be colourized into Gimp
gradients dialogue -> select required gradient map
colours -> map -> gradient map.
Done.