diff --git a/ChangeLog.txt b/ChangeLog.txt index a622c6f8..c3be2b63 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -30,6 +30,9 @@ without having to pass -Djava.library.path=/usr/lib to java. the performance of the TurboJPEG Java API. It can be run with 'java -cp turbojpeg.jar TJBench'. +[8] cjpeg can now be used to generate JPEG files with the RGB colorspace +(feature ported from jpeg-8d.) + 1.2.1 ===== diff --git a/change.log b/change.log index c7885a78..ebd51e37 100644 --- a/change.log +++ b/change.log @@ -4,6 +4,15 @@ information relevant to libjpeg-turbo. CHANGE LOG for Independent JPEG Group's JPEG software +Version 8d 15-Jan-2012 +----------------------- + +Add cjpeg -rgb option to create RGB JPEG files. +Using this switch suppresses the conversion from RGB +colorspace input to the default YCbCr JPEG colorspace. +Thank to Michael Koch for the initial suggestion. + + Version 8b 16-May-2010 ----------------------- diff --git a/cjpeg.1 b/cjpeg.1 index f59d290b..d336cc8b 100644 --- a/cjpeg.1 +++ b/cjpeg.1 @@ -49,6 +49,11 @@ By saying .BR \-grayscale , you'll get a smaller JPEG file that takes less time to process. .TP +.B \-rgb +Create RGB JPEG file. +Using this switch suppresses the conversion from RGB +colorspace input to the default YCbCr JPEG colorspace. +.TP .B \-optimize Perform optimization of entropy encoding parameters. Without this, default encoding parameters are used. diff --git a/cjpeg.c b/cjpeg.c index 703ce100..495a5bd0 100644 --- a/cjpeg.c +++ b/cjpeg.c @@ -3,7 +3,7 @@ * * This file was part of the Independent JPEG Group's software: * Copyright (C) 1991-1998, Thomas G. Lane. - * Modified 2003-2008 by Guido Vollbeding. + * Modified 2003-2011 by Guido Vollbeding. * Modifications: * Copyright (C) 2010, D. R. Commander. * For conditions of distribution and use, see the accompanying README file. @@ -155,6 +155,7 @@ usage (void) fprintf(stderr, "Switches (names may be abbreviated):\n"); fprintf(stderr, " -quality N[,...] Compression quality (0..100; 5-95 is useful range)\n"); fprintf(stderr, " -grayscale Create monochrome JPEG file\n"); + fprintf(stderr, " -rgb Create RGB JPEG file\n"); #ifdef ENTROPY_OPT_SUPPORTED fprintf(stderr, " -optimize Optimize Huffman table (smaller file, but slow compression)\n"); #endif @@ -289,6 +290,10 @@ parse_switches (j_compress_ptr cinfo, int argc, char **argv, /* Force a monochrome JPEG file to be generated. */ jpeg_set_colorspace(cinfo, JCS_GRAYSCALE); + } else if (keymatch(arg, "rgb", 3)) { + /* Force an RGB JPEG file to be generated. */ + jpeg_set_colorspace(cinfo, JCS_RGB); + } else if (keymatch(arg, "maxmemory", 3)) { /* Maximum memory in Kb (or Mb with 'm'). */ long lval; diff --git a/usage.txt b/usage.txt index 496d9ce0..775a5440 100644 --- a/usage.txt +++ b/usage.txt @@ -80,6 +80,10 @@ The basic command line switches for cjpeg are: saying -grayscale, you'll get a smaller JPEG file that takes less time to process. + -rgb Create RGB JPEG file. + Using this switch suppresses the conversion from RGB + colorspace input to the default YCbCr JPEG colorspace. + -optimize Perform optimization of entropy encoding parameters. Without this, default encoding parameters are used. -optimize usually makes the JPEG file a little smaller,