Fixed bug that includes 'y' at the end of output

Instead of excluding pixels that were completely black, remove individual pixel RGB values that are null starting from the end of the pixels.