--- src/plugins/imagemagick.cpp 2013-03-18 14:21:49.848848166 +0900 +++ src/plugins/imagemagick.cpp.new 2013-03-18 15:37:57.502107423 +0900 @@ -124,10 +124,10 @@ for(int x = 0; x < width; ++x) { - dst_pixels[4*x + 0] = static_cast(src_pixels[x].red >> shift); - dst_pixels[4*x + 1] = static_cast(src_pixels[x].green >> shift); - dst_pixels[4*x + 2] = static_cast(src_pixels[x].blue >> shift); - dst_pixels[4*x + 3] = static_cast(255 - (src_pixels[x].opacity >> shift)); + dst_pixels[4*x + 0] = static_cast(src_pixels[x].red / QuantumRange * QuantumRange); + dst_pixels[4*x + 1] = static_cast(src_pixels[x].green / QuantumRange * QuantumRange); + dst_pixels[4*x + 2] = static_cast(src_pixels[x].blue / QuantumRange * QuantumRange); + dst_pixels[4*x + 3] = static_cast(255 - (src_pixels[x].opacity / QuantumRange * QuantumRange)); } } } @@ -142,9 +142,9 @@ for(int x = 0; x < width; ++x) { - dst_pixels[3*x + 0] = static_cast(src_pixels[x].red >> shift); - dst_pixels[3*x + 1] = static_cast(src_pixels[x].green >> shift); - dst_pixels[3*x + 2] = static_cast(src_pixels[x].blue >> shift); + dst_pixels[3*x + 0] = static_cast(src_pixels[x].red / QuantumRange * QuantumRange); + dst_pixels[3*x + 1] = static_cast(src_pixels[x].green / QuantumRange * QuantumRange); + dst_pixels[3*x + 2] = static_cast(src_pixels[x].blue / QuantumRange * QuantumRange); } } }