Extract the "overall colors" of an image to apply another?
Mostra commenti meno recenti
I've been meaning to show my students a way to "borrow" the color palette of an image to apply to another?
Take the Mona Lisa, for example. It has its own "tones" and "mood". Suppose there was a way to load that image into Matlab and extract its "most vital" color characteristic? And then be able to "apply" this "personality" to any other existing image? I know, it's a crazy idea and I've been thinking what could possibly be the "linking mechanism" between the two images or between any two sets of images, for that matter, that would make this possible? Perhaps the "Brightness" levels? To me, it's clearly a problem of "mapping tones" between imiages but I have no idea where to start. But one thing is sure, the students would immediately understand the idea and, from a pedagogical point of view, it would go a long way towards building an "abstract" view of "image processing" which is what the class is about.
Risposta accettata
Più risposte (2)
Richard Burnside
il 14 Giu 2023
Modificato: Richard Burnside
il 14 Giu 2023
1 voto
The imread command will return the indexed image and the 256x3 colormap of the image:
[X,cmap] = imread('corn.tif');
You can work with that colormap to apply it to another image using the colormap command.
4 Commenti
Roger Breton
il 14 Giu 2023
Roger Breton
il 14 Giu 2023
Modificato: Walter Roberson
il 15 Giu 2023
Roger Breton
il 14 Giu 2023
Modificato: Roger Breton
il 14 Giu 2023
Richard Burnside
il 14 Giu 2023
The answer supplied below by Image Analyst seems to have that process worked out. Pretty amazing results.
Image Analyst
il 14 Giu 2023
1 voto
The best algorithm I've seen for transferring the color gamut is Mark Grundland Color Histogram Specification by Histogram Warping

Sorry, I don't have code for that algorithm.
3 Commenti
Roger Breton
il 14 Giu 2023
Image Analyst
il 14 Giu 2023
If youi can do it, let me know. And post it to the File Exchange. A couple of years ago I made a s tab at it and I got the first few steps done but then it got into some pretty sophisticated math that I didn't know how to translate into MATLAB so I gave it up.

Roger Breton
il 14 Giu 2023
Categorie
Scopri di più su Image Processing Toolbox in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!





