フィルターのクリア

How can I make image with specific color in each column???

3 ビュー (過去 30 日間)
Beso_h
Beso_h 2020 年 11 月 10 日
編集済み: Setsuna Yuuki. 2020 年 11 月 10 日
a) 256 × 256 image that have 256 colors on it starting 0 till 255 (the first column is black, the last column is white, and in between all the gray shades)
b) 256 × 256 image that have just 8 colors on it starting 0 till 7 (the first column is black, the last column is white, and in between all the gray shades)

採用された回答

Setsuna Yuuki.
Setsuna Yuuki. 2020 年 11 月 10 日
編集済み: Setsuna Yuuki. 2020 年 11 月 10 日
You can use this code to generate the color rows:
clear all;
figure
for bits = 1:1:8
Color=2^bits; %Number of colors level
intervalo = 1/(Color-1); %intervales to each color
C = zeros(Color,1,3); %To change rows by columns change this line zeros(1,Color,3)
s = 1:-intervalo:0;
C(:,:,1) = s'; % Red
C(:,:,2) = s'; % Green
C(:,:,3) = s'; % Blue
subplot(3,3,bits);
image(C); % C is mean of three channel (RGB)
numeroBits = num2str(bits);
title({'\fontsize{12} Número de bits:' numeroBits});
axis off;
end
To resize you can use imresize();

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by