implemented 유병후(libsora's) take on using lodepng