<!-- manual page source format generated by PolyglotMan v3.2, --> <!-- available at http://polyglotman.sourceforge.net/ --> <html> <head> <title>IM_IFTHENELSE(3) manual page</title> </head> <body bgcolor='white'> <a href='#toc'>Table of Contents</a><p> <h2><a name='sect0' href='#toc0'>Name</a></h2> im_ifthenelse - use an unsigned char image to join two images together <h2><a name='sect1' href='#toc1'>Synopsis</a></h2> <b>#include <vips/vips.h></b> <p> <b>int im_ifthenelse(c, a, b, out)</b> <br> <b>IMAGE *c, *a, *b, *out;</b> <p> <b>int im_blend(c, a, b, out)</b> <br> <b>IMAGE *c, *a, *b, *out;</b> <p> <h2><a name='sect2' href='#toc2'>Description</a></h2> <b>im_ifthenelse</b> builds an output image which uses some pels from a and some from b: if the conditional image c is non-zero at that point, the pel comes from a; if it is zero, the pel comes from b. <p> The conditional image c can have either 1 band, in which case entire pels come either from a or b, or n bands, where n is the number of bands in both a and b, in which case individual band elements are chosen from a and b. <p> Images a and b must match in size, type and number of bands. <p> <a href='im_blend.3.html'><b>im_blend(3)</b></a> works just as <a href='im_ifthenelse.3.html'>im_ifthenelse(3)</a> , except that instead of selecting between a and b, values in the condition image are used to softly blend between the two. 255 means a only, 0 means b only, 128 means 50:50. <p> <h2><a name='sect3' href='#toc3'>Return Value</a></h2> 0 on success and -1 on error. <h2><a name='sect4' href='#toc4'>See Also</a></h2> <a href='im_equal.3.html'>im_equal(3)</a> , <a href='im_and.3.html'>im_and(3)</a> . <h2><a name='sect5' href='#toc5'>Copyright</a></h2> National Gallery <h2><a name='sect6' href='#toc6'>Author</a></h2> J. Cupitt <p> <hr><p> <a name='toc'><b>Table of Contents</b></a><p> <ul> <li><a name='toc0' href='#sect0'>Name</a></li> <li><a name='toc1' href='#sect1'>Synopsis</a></li> <li><a name='toc2' href='#sect2'>Description</a></li> <li><a name='toc3' href='#sect3'>Return Value</a></li> <li><a name='toc4' href='#sect4'>See Also</a></li> <li><a name='toc5' href='#sect5'>Copyright</a></li> <li><a name='toc6' href='#sect6'>Author</a></li> </ul> </body> </html>