Borrar filtros
Borrar filtros

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

3 visualizaciones (últimos 30 días)
Beso_h
Beso_h el 10 de Nov. de 2020
Editada: Setsuna Yuuki. el 10 de Nov. de 2020
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)

Respuesta aceptada

Setsuna Yuuki.
Setsuna Yuuki. el 10 de Nov. de 2020
Editada: Setsuna Yuuki. el 10 de Nov. de 2020
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();

Más respuestas (0)

Categorías

Más información sobre Introduction to Installation and Licensing en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by