Applying tint to photo

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jojowls
    New Member
    • Jun 2013
    • 1

    #1

    Applying tint to photo

    my question is how can i apply an orange tint intensity of 40 to a photo

    i tried to do part of it but am confused after that
    Code:
    file = pickAFile()
    pic = makePicture(file)
    w = getWidth(pic)
    h = getHeight(pic)
    intensity = requestIntegerInRange("What intensity?",1,99)
    tintColor = pickAColor()
    samplePicture = makeEmptyPicture(1,1)
    samplePixel = getPixel (samplePicture,0,0)
    
    setColor (samplePixel,tintColor)
    tintRed = getRed(samplePixel)
    #printNow (tintRed)
    tintGreen = getGreen(samplePixel)
    #printNow (tintGreen)
    tintBlue = getBlue(samplePixel)
    #printNow (tintBlue)
    
    show (pic)
    thx in advance
    Last edited by bvdet; Jun 12 '13, 02:32 PM. Reason: Please use code tags when posting code [code]....[/code]
  • kudos
    Recognized Expert New Member
    • Jul 2006
    • 127

    #2
    (I am not close to my python interpreter, so I don't get to test it....)

    But isn't orange, 255,160,0 i RGB colors? I assume 40 tint, means 40% orange, so what would happen if you added the following to each pixel:

    R = (R + (255*0.4))%255
    G = (G + (160*0.4))%255
    B = (B + (0*0.4))%255

    Would that give you a orange tint?

    Comment

    Working...