Skip to content

Brightness, Sharpness, Constrast, Color at magnitude 0 should have v=1? #24

@A-Telfer

Description

@A-Telfer

It seems like some of the PIL functions are not centered? This would likely impact results by causing lower magnitudes to lead to higher distortions

ie. here's a function that appears centered

def Rotate(img, v):  # [-30, 30]  NOTE: should this be [0, 30]?
    assert -30 <= v <= 30 
    if random.random() > 0.5:
        v = -v 
    return img.rotate(v)

vs the color function that is not centered

def Color(img, v):  # [0.1,1.9]
    assert 0.1 <= v <= 1.9
    return PIL.ImageEnhance.Color(img).enhance(v)

instead, perhaps it should be this?

def Color(img, v):  # [0,0.9]
    assert 0 <= v <= 0.9
    if random.random() > 0.5:
        v = -v
    return PIL.ImageEnhance.Color(img).enhance(1+v)

Thanks for sharing this repo! It's very readable :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions