__declspec( dllexport ) MStatus initializePlugin( MObject obj ) { char *version; #ifdef MAYA2010 version = "2010"; #else version = "2008"; #endif MImage ip1; ip1.readFromFile( "E:/Release/bump.jpg" ); unsigned char *ip1Pix = ip1.pixels(); unsigned int ip1width, ip1height; ip1.getSize( ip1width, ip1height ); MImage ip2; ip2.readFromFile( "E:/Release/transReflect.jpg" ); unsigned char *ip2Pix = ip2.pixels(); unsigned int ip2Width, ip2Height; ip2.getSize( ip2Width, ip2Height ); float *pixels = new float[ ip2Width, ip2Height ]; for( int y = 150; y < 200; y++ ) { for( int x = 100; x < 150; x++ ) { ip2Pix[ ( y * ip2Width + x ) * ip2.depth() ] += 1;//ip1Pix[ ( y * ip1width + x ) * ip1.depth() ]; ip2Pix[ ( y * ip2Width + x ) * ip2.depth() + 1 ] += 1;//ip1Pix[ ( y * ip1width + x ) * ip1.depth() + 1 ]; ip2Pix[ ( y * ip2Width + x ) * ip2.depth() + 2 ] += 1;//ip1Pix[ ( y * ip1width + x ) * ip1.depth() + 2 ]; } } MImage img; img.create( ip2Width, ip2Height, ip2.depth() ); img.setPixels( ip2Pix, ip2Width, ip2Height ); img.writeToFile( "E:/Release/f****d.jpg", "jpg" ); MFnPlugin plugFn( obj, "The LABS", version ); MStatus stat = plugFn.registerCommand( "setupRGBShaders", setupRGBShaders::creator ); if( !stat ) { stat.perror( "Registering Command setupRGBShaders" ); return MS::kFailure; } return MS::kSuccess; }