1 // This tool makes the image grayscale and transparent.
5 #include <kcmdlineargs.h>
6 #include <kapplication.h>
9 int main( int argc
, char* argv
[] )
13 QImage
im( argv
[ 1 ] );
23 QRgb c
= im
.pixel( x
, y
);
24 QRgb c2
= qRgba( qGray( c
), qGray( c
), qGray( c
), qAlpha( c
) / 2 );
25 im
.setPixel( x
, y
, c2
);
27 im
.save( "result.png", "PNG" );