Effacer les filtres
Effacer les filtres

Changing photo intensity without changes to color map

1 vue (au cours des 30 derniers jours)
adrian leung
adrian leung le 13 Déc 2021
Just curious is it possible to change intensity/brightness without making changes to the color map itself?

Réponses (2)

Chunru
Chunru le 13 Déc 2021
try "brighten":
subplot(121);
I = imread("pout.tif");
imshow(I);
subplot(122)
J = imadjust(I, [0.3 0.7]);
imshow(J)
  1 commentaire
adrian leung
adrian leung le 13 Déc 2021
Thanks for the prompt reply.
I saved the final image as uncomrpessed tiff, but its an RGB, not indexed, which defeats the purpose of keeping the original source color map.
Also the dimension is reduced to 893x1273 instead of original 1200x1600.
Is there anyway i can bypass these problems?
Tried using rgb2ind with a colormap (excel table) in variable tab generated from source tiff, however theres error i cant comprehend.
I = imread("sc.tif ");
J = imadjust(I, [0.3 0.7 ]);
K = rgb2ind(J,colormap)
imshow(K)
Error using dither>parse_inputs (line 92)
DITHER(RGB,map): the RGB image has to be a three-dimensional array.
Error in dither (line 47)
[X,m,qm,qe] = parse_inputs(varargin{:});
Error in rgb2ind (line 110)
X = dither(RGB,map);
Error in untitled (line 4)
K = rgb2ind(J,colormap)

Connectez-vous pour commenter.


Image Analyst
Image Analyst le 13 Déc 2021
Sure. For a gray scale image you can change it in a variety of ways like adding, subtracting, dividing, using imdjust(), adapthisteq(), etc. Gray scale images don't really have a colormap. When you do that, you're changing the image itself.
Indexed images have a colormap. If you change the image, the values will be different and will now be using a different color from the colormap. So you don't really normally want to do that. You could change the colormap itself, or you could use caxis() to zoom in on a particular part of the colormap and apply just that part. Changing the colormap on an indexed image only changes it's displayed appearance. The image itself does not change - only the colormap.

Catégories

En savoir plus sur Colormaps dans Help Center et File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by