mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-11 04:07:21 +03:00
Fix rounding error on RGB to L conversion
This commit is contained in:
parent
302b86591e
commit
d68147ce89
|
@ -44,7 +44,8 @@
|
|||
#define L(rgb)\
|
||||
((INT32) (rgb)[0]*299 + (INT32) (rgb)[1]*587 + (INT32) (rgb)[2]*114)
|
||||
#define L24(rgb)\
|
||||
((rgb)[0]*19595 + (rgb)[1]*38470 + (rgb)[2]*7471)
|
||||
((rgb)[0]*19595 + (rgb)[1]*38470 + (rgb)[2]*7471 + 0x8000)
|
||||
|
||||
|
||||
#ifndef round
|
||||
double round(double x) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user