Вниз
Скачать: CL | DM;

монохром   Найти похожие ветки 

← →
Тиммммм   (2007-01-05 16:34) [0]

народ может кто знает как из цветной картинки сделать черно-белую,спасибо


← →
Desdechado ©   (2007-01-05 16:37) [1]

каждый пиксел с цветом больше энного сделать черным, меньше энного - белым


← →
antonn ©   (2007-01-05 16:41) [2]

procedure PrepareBitmap(_B_out:Tbitmap);
const  MaxPixelCount = MaxInt div SizeOf(TRGBTriple);
type  PRGBArray = ^TRGBArray;
TRGBArray = array[0..MaxPixelCount-1] of TRGBTriple;
var x, y: Integer; RowOut: PRGBArray;
begin
_B_out.PixelFormat:=pf24bit;
for y:=0 to _B_out.Height-1 do begin
   RowOut:= _B_out.ScanLine[y];
  for x:=0 to _B_out.Width-1 do begin
        RowOut[x].rgbtRed:=round(RowOut[x].rgbtRed*0.30+RowOut[x].rgbtGreen*0.59+RowOut[x].rgbtBlue*0.11);
        RowOut[x].rgbtGreen:=RowOut[x].rgbtRed;
        RowOut[x].rgbtBlue:=RowOut[x].rgbtRed;
  end;
end
end;


← →
antonn ©   (2007-01-05 16:46) [3]

если нужно сделать порог цвета (что сомневаюсь):
Lr,Lg,Lb:byte - пороговые значения для каналов красного, зеленого, синего
procedure PrepareBitmapLevel(_B_out:Tbitmap; Lr,Lg,Lb:byte);
const Pixels = MaxInt div SizeOf(TRGBTriple);
type PRGBArray = ^TRGBArray;
    TRGBArray = array[0..Pixels-1] of TRGBTriple;
var x, y: Integer; RowOut: PRGBArray;
begin
 _B_out.PixelFormat:=pf24bit;
 for y:=0 to _B_out.Height-1 do begin
    RowOut:= _B_out.ScanLine[y];
   for x:=0 to _B_out.Width-1 do begin
      if (RowOut[x].rgbtRed>Lr)and(RowOut[x].rgbtGreen>Lg)and(RowOut[x].rgbtBlue>Lb) then begin
         RowOut[x].rgbtRed:=255;
         RowOut[x].rgbtGreen:=255;
         RowOut[x].rgbtBlue:=255;
      end else begin
         RowOut[x].rgbtRed:=0;
         RowOut[x].rgbtGreen:=0;
         RowOut[x].rgbtBlue:=0;
      end;
   end;
 end
end;


← →
Тиммммм   (2007-01-05 16:47) [4]

спасибо выручили



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.44 MB
Время: 0.036 c
2-1168031918
Riply
2007-01-06 00:18
2007.01.21
GetMem or New ? That is a question ! :))


1-1164281315
Anatoly Podgoretsky
2006-11-23 14:28
2007.01.21
Теоритический вопрос про потоки и контекст


2-1167314120
Sn
2006-12-28 16:55
2007.01.21
Подсчет слов совпадающих с данным в текстовом файле


4-1157415257
Psychedelic
2006-09-05 04:14
2007.01.21
EnumDisplaySettingsEx - crash


8-1148657072
F@R@_on
2006-05-26 19:24
2007.01.21
Увеличение иконки




   Наверх