AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Suchfunktion Ergebnis der Suchanfrage

Ergebnis der Suchanfrage


Datum des Suchindex: Heute, 05:02

Parameter dieser Suchanfrage:

Suche in Thema: [GR32] How to add intensity?
Suche alle Beiträge, die von "Medium" geschrieben wurden
• Suchmethode: "Suche nach allen Begriffen"
• Nach Datum (firstpost) sortiert
• Zeige Treffer als Beiträge
Zeige 8 von insges. 8 Treffern
Suche benötigte 0.002s

Es liegen Ergebnisse in folgenden Bereichen vor:

  • Forum: Multimedia

    Re: [GR32] How to add intensity?

      Delphi
      by Medium, 25. Jan 2010
    Mh, then there is no obvious reason for this darkening. You could use your reference output and compare a white-tinted image (= implicit conversion to grayscales) of just a pure red, green and blue area to derive the weights they used, to make your output similar to it. That is, if you approve of the reference :)
  • Forum: Multimedia

    Re: [GR32] How to add intensity?

      Delphi
      by Medium, 25. Jan 2010
    This might sound old, but I learned by doing. I have a general interest in graphics, so my spare time projects often are somehow related. And every time I hit a wall, I fire up good ole oncle google and find something eventually -> *pow* knowledge enhanced :)
    I couldn't even recommend any general sources or books, since all I do is basically self-taught by doing, fiddeling around and reading...
  • Forum: Multimedia

    Re: [GR32] How to add intensity?

      Delphi
      by Medium, 23. Jan 2010
    Aha! You basically want a color tint. The 100% formula for this is:

    Brightness := (original.R + original.G + original.B)/(3*255) // normalized to 0..1
    NewColor := RGB(tint.R*Brightness, tint.G*Brightness, tint.B*Brightness)

    That is what jfheins already wrote, I suppose your implementation had rounding issues or did not normalize brightness (I'm too lazy to verfy this now :)).

    This...
  • Forum: Multimedia

    Re: [GR32] How to add intensity?

      Delphi
      by Medium, 23. Jan 2010
    As I already said, change the line
    tmp := t*a + (1-t)*b;
    to
    tmp := (1-t)*a + t*b;

    Another thing is, that it's not clear to me, which variable holds the original color. Color or Row? If it's Row, then change
    Row.R := Lerp(Color.R, (Color.R * Row.R) div 255, APercent / 100);
    to
    Row.R := Lerp(Row.R, (Color.R * Row.R) div 255, APercent / 100);
  • Forum: Multimedia

    Re: [GR32] How to add intensity?

      Delphi
      by Medium, 22. Jan 2010
    If this is not what you get after the change, please post the whole part of your source. Otherwise we won't come far here. I won't ask for it a third time, since the code you provided had little to do with the Lerp() function, and as such can't relate to the problem. (It should work as well if you handled each channel separately, as already said.)
  • Forum: Multimedia

    Re: [GR32] How to add intensity?

      Delphi
      by Medium, 22. Jan 2010
    Oops, I switched the "t" and "(1-t)". Just exchange these, and you're good to go.

    Regarding the code you posted: You cannot simply multiply with whole combined RGB-values. You must handle each color channel separately.
  • Forum: Multimedia

    Re: [GR32] How to add intensity?

      Delphi
      by Medium, 22. Jan 2010
    :gruebel: Lerp() can be used for just this. Use the original color of a pixel as first parameter, and the color of that pixel as if the effect was applied fully as second. Pass any value between 0 and 1 as third parameter, and get a linear interpolation between the original and the fully affected color. What exactly is your problem? You might also want to provide some more of your actual code...
  • Forum: Multimedia

    Re: [GR32] How to add intensity?

      Delphi
      by Medium, 22. Jan 2010
    I haven't really understood what you do with this particular filter, but it looks like you're looking for simple linear interpolation, where you can shift beween two values freely.


    function Lerp(a, b: Byte; t: Double): Byte;
    var
    tmp: Double;
    begin
    tmp := t*a + (1-t)*b;
    if tmp<0 then result := 0 else
    if tmp>255 then result := 255 else


URL zu dieser Suchanfrage:

https://www.delphipraxis.net/dp_search.php?do=usersearch&search_username=Medium&search_exact_username=1&search_sortby=dateline&search_resulttype=post&search_matchmode=0&searchthreadid=146557
Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 05:19 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz