diff --git a/ChangeLog b/ChangeLog index 03eaf704..c2dc9110 100644 --- a/ChangeLog +++ b/ChangeLog @@ -69,6 +69,7 @@ - VIPS_EXEEXT is now part of the exported API - im_blend() also does sizealike, oops - jpeg write was not inverting CMYK, thanks Ole +- im_falsecolour() converts to mono 8-bit for you 30/11/10 started 7.24.0 - bump for new stable diff --git a/TODO b/TODO index 0bfedfac..e6c46623 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,9 @@ +- maplut should force to 8/16 bit unsigned? or does it? + +- im_vip2tiff() pyr builder should use new temp system + +- can isanalyze still add spurious messages to the vips error buffer? + - icc import / export should cast their inputs, they insist on uchar/ushort at the moment @@ -9,7 +15,9 @@ -- can we call vips7 funcs from the vips8 interface? +- can we call vips7 funcs from the vips8 interface? we already have vips8 from + vips7 + - revisit orc conv diff --git a/libvips/conversion/im_falsecolour.c b/libvips/conversion/im_falsecolour.c index 6983d51b..7a699288 100644 --- a/libvips/conversion/im_falsecolour.c +++ b/libvips/conversion/im_falsecolour.c @@ -10,6 +10,8 @@ * 29/1/10 * - cleanups * - gtkdoc + * 12/7/11 + * - force input to mono 8-bit for the user */ /* @@ -318,7 +320,8 @@ static unsigned char PET_colour[][3] = { * @in: input image * @out: output image * - * Turn a 1-band 8-bit image into a 3-band 8-bit image with a false colour + * Force @in to 1 band, 8-bit, then transform to + * 3-band 8-bit image with a false colour * map. The map is supposed to make small differences in brightness more * obvious. * @@ -329,15 +332,18 @@ static unsigned char PET_colour[][3] = { int im_falsecolour( IMAGE *in, IMAGE *out ) { + IMAGE *t[2]; IMAGE *lut; - /* Check our args. + /* Check our args, force to mono 8-bit. */ if( im_piocheck( in, out ) || - im_check_mono( "im_falsecolour", in ) || - im_check_uncoded( "im_falsecolour", in ) || - im_check_format( "im_falsecolour", in, IM_BANDFMT_UCHAR ) ) + im_check_uncoded( "im_falsecolour", in ) ) + im_open_local_array( out, t, 2, "im_falsecolour", "p" ) || + im_extract_band( in, t[0], 0 ) || + im_clip2fmt( t[0], t[1], IM_BANDFMT_UCHAR ) return( -1 ); + in = t[1]; if( !(lut = im_image( (PEL *) PET_colour, 1, 256, 3, IM_BANDFMT_UCHAR )) )