mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 01:46:18 +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