This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function btoaUTF8(data) { | |
const utf8Data = new TextEncoder().encode(data); | |
let binaryString = ""; | |
for (let i = 0; i < utf8Data.length; i++) { | |
binaryString += String.fromCharCode(utf8Data[i]); | |
} | |
return btoa(binaryString); | |
} | |
function atobUTF8(data) { | |
const decodedData = atob(data); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from glob import glob | |
import os.path as path | |
from PIL import Image | |
def convert(img): | |
'''Convert an RGBA image to an RGB image | |
If the passed image has: | |
img.mode == 'RGBA' | |
then it will be converted to RGB. |