フィルターのクリア

How can I Change grayscale color?

3 ビュー (過去 30 日間)
saleh Alghamdi
saleh Alghamdi 2017 年 2 月 6 日
コメント済み: saleh Alghamdi 2017 年 2 月 12 日
Hi Guys,
I have an image at the grayscale color and black background and I want to change the black background to white color and change the gray scale to pink scale that depends on concentration of color.
Can anyone tell me how I can do that?

採用された回答

Walter Roberson
Walter Roberson 2017 年 2 月 6 日
cmap = pink(256); %pink!
cmap(1,:) = [1.0 1.0 1.0]; %replace first entry with white
colormap(cmap)
  3 件のコメント
Walter Roberson
Walter Roberson 2017 年 2 月 6 日
sample_plot = sort( randi([0 255], 64, 80, 'uint8') ); %sample grayscale data
cmap = pink(256); %pink!
cmap(1,:) = [1.0 1.0 1.0]; %replace first entry with white
Then
image(sample_plot)
colormap(cmap)
or
imshow(sample_plot, cmap)
The white blocks that show up against the top edge are places where the background values of 0 have been drawn as white as you requested.
saleh Alghamdi
saleh Alghamdi 2017 年 2 月 12 日
much appreciated.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeColor Space Formatting and Conversions についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by