伪彩?(50分)

金少

Unregistered / Unconfirmed
GUEST, unregistred user!
什幺是伪彩呀, 它有什幺作用?
请指教!
 
To:张无忌
能详细说明吗?
 
现在好像已经不太找得到伪彩的了吧?~
 
只能256色,不能设为16位真彩.
一般出现在早期笔记本电脑.
 
伪彩一般是指:对黑白图像,或色彩不是很好的彩色图像把他处理成为黑白色效果会
更好。在这两种情况下我人面对就是黑白图像,而人眼对黑白的分辨在灰度差小于5时
就不行了,这样可以把图像按照灰色的差对应的转换为一定的彩色就称为伪彩。
 
通常伪彩有几种算法呀, 还是只有唯一的一种算法?
最好能说说它的算法, 谢谢!
 

procedure TMainForm.PesudocolorClick(Sender: TObject); var
p: PByteArray;
x, y: Integer;
Bmp: TBitmap;
Gray: byte;
begin
Bmp := TBitmap.Create;
Bmp.Assign(ChildForm.Image1.Picture.Bitmap);
Bmp.PixelFormat := pf24Bit;
for y := 0 to Bmp.Height - 1 do
begin
p := Bmp.scanline[y];
for x := 0 to Bmp.Width - 1 do
begin
Gray := Round(p[x * 3 + 2] * 0.3 + p[x * 3 + 1] * 0.59 + p[x
* 3]
* 0.11);
if gray < 63 then
begin

p[x * 3 + 2] := 0;
p[x * 3 + 1] := 254 - 4 * gray;
p[x * 3] := 255;
end;
if (64 <= gray) and (gray < 127) then
begin
p[x * 3 + 2] := 0;
p[x * 3 + 1] := 4 * gray - 254;
p[x * 3] := 510 - 4 * gray;
end;
if (128 <= gray) and (gray < 191) then
begin
p[x * 3 + 2] := 4 * gray - 510;
p[x * 3 + 1] := 255;
p[x * 3] := 0;
end;
if (192 <= gray) then
begin
p[x * 3 + 2] := 255;
p[x * 3 + 1] := 1022 - 4 * gray;
p[x * 3] := 0;
end;

end;
end;

ChildForm.Image1.Picture.Bitmap.Assign(Bmp);

Bmp.Free;

end;
 
多人接受答案了。
 
顶部