Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //pseudocode:
- //loop through width and height of source image
- //get color in image $image[ 'mask' ] at pixel ($col,$row)
- $pix[ 'mask' ] = imagecolorat( $image[ 'mask' ], $col, $row );
- //get color in image $image[ 'rgb' ] at pixel ($col,$row)
- $pix[ 'rgb' ] = imagecolorat( $image[ 'rgb' ], $col, $row );
- //if pixel in $image['mask'] at ($cow,$row) is white:
- //set pixel in $image['combo'] at ($cow,$row) as fully transparent
- //else
- //set pixel in $image['combo'] at ($cow,$row) as pixel color in $image['rgb'] at ($cow,$row) with full opacity
- //save resulting image as new file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement