AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Multimedia Delphi Black and white - advanced
Thema durchsuchen
Ansicht
Themen-Optionen

Black and white - advanced

Ein Thema von WojTec · begonnen am 3. Dez 2010 · letzter Beitrag vom 5. Dez 2010
 
WojTec

Registriert seit: 17. Mai 2007
482 Beiträge
 
Delphi XE6 Professional
 
#3

Re: Black and white - advanced

  Alt 4. Dez 2010, 11:14
This is what I wrote:

Delphi-Quellcode:
function Input(AInput: Integer): Single;
begin
  Result := (0.33 * AInput) / 100;
end;

C := (Bits.G + Bits.B) div 2;
M := (Bits.R + Bits.B) div 2;
Y := (Bits.R + Bits.G) div 2;
Luminousity := Round(Bits.R * Input(Reds)) + Round(Bits.G * Input(Greens)) + Round(Bits.B * Input(Blues)) + Round(C * Input(Cyans)) + Round(M * Input(Magentas)) + Round(Y * Input(Yellows));
Luminousity := IntToByte(Luminousity);
For input 40, 60, 40, 60, 20, 80 (default values from PS) result is correct (the same as like with R+G+B/3). Nice. Next I tested maximum white preset (all =100) - correct. Next I got maximum black (all =0) - incorrect, image is black and should be very dark. Last values I got was -40, 235, 144, -68, -3, -107 - effect near to infrared image, in my function also incorrect

It seems that for all values > 0 is ok, but for <= 0 and near 0 result is incorrect How to fix this problem?
Angehängte Grafiken
Dateityp: jpg incorrect__buuuuu.jpg (114,5 KB, 20x aufgerufen)
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 16:25 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz