summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/JPEGOutputImage.cxx6
-rw-r--r--src/TIFFOutputImage.cxx6
2 files changed, 6 insertions, 6 deletions
diff --git a/src/JPEGOutputImage.cxx b/src/JPEGOutputImage.cxx
index bfe4595..0a5eb00 100644
--- a/src/JPEGOutputImage.cxx
+++ b/src/JPEGOutputImage.cxx
@@ -69,9 +69,9 @@ JPEGOutputImage::init_internal(int w1, int h1) {
int
JPEGOutputImage::set_pixel_internal(int x, int r, int g, int b) {
- row[x*3+0] = (unsigned char) r;
- row[x*3+1] = (unsigned char) g;
- row[x*3+2] = (unsigned char) b;
+ row[x*3+0] = (unsigned char) (r / 255);
+ row[x*3+1] = (unsigned char) (g / 255);
+ row[x*3+2] = (unsigned char) (b / 255);
return 0;
}
diff --git a/src/TIFFOutputImage.cxx b/src/TIFFOutputImage.cxx
index 4034c97..156079c 100644
--- a/src/TIFFOutputImage.cxx
+++ b/src/TIFFOutputImage.cxx
@@ -62,9 +62,9 @@ TIFFOutputImage::init_internal(int w1, int h1) {
int
TIFFOutputImage::set_pixel_internal(int x, int r, int g, int b) {
- row[x*4+0] = (unsigned char) r;
- row[x*4+1] = (unsigned char) g;
- row[x*4+2] = (unsigned char) b;
+ row[x*4+0] = (unsigned char) (r / 255);
+ row[x*4+1] = (unsigned char) (g / 255);
+ row[x*4+2] = (unsigned char) (b / 255);
row[x*4+3] = 255;
return 0;