Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two questions about numbers #60

Open
bakert opened this issue Jul 24, 2017 · 0 comments
Open

Two questions about numbers #60

bakert opened this issue Jul 24, 2017 · 0 comments

Comments

@bakert
Copy link
Contributor

bakert commented Jul 24, 2017

(1)

Hexgradient = Image.new('L', (1, RGB_MAX_0))

Shouldn't that be (0, RGB_MAX_0)? 0-255. I'm not totally sure what this does but it seems like 1 and 256 go together and 0 and 255 go together. Not 1 and 255.

(2)

#map the gradient
for x in range(QUARTER):
    Hexgradient.putpixel((0, x), RGB_MAX_0)
for x in range(QUARTER):
    Hexgradient.putpixel((0, QUARTER + x), RGB_MAX_0 - x)
for x in range(HALF):
    Hexgradient.putpixel((0, BAD_HALF + x), BAD_THREE_QUARTERS - int(1.5 * x))

# create a horizontal gradient...
gradient = Image.new('L', (RGB_MAX_0, 1))

#map the gradient
for x in range(HALF):
    gradient.putpixel((x, 0), int(1.5 * x))
for x in range(QUARTER):
    gradient.putpixel((BAD_HALF + x, 0), BAD_THREE_QUARTERS + x)
for x in range(QUARTER):
    gradient.putpixel((BAD_THREE_QUARTERS + x, 0), RGB_MAX_0 - 1)

I called these constants BAD_HALF and BAD_THREE_QUARTERS because they're very close to that proportion of the relevant RGB_MAX but they aren't precisely. I wonder if they should be precisely or if they've been very finely judged by eye.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant