Spaces:
Running
Running
Update utils.py
Browse files
utils.py
CHANGED
@@ -2,7 +2,7 @@ import cv2
|
|
2 |
import numpy as np
|
3 |
from PIL import Image, PngImagePlugin
|
4 |
|
5 |
-
def
|
6 |
# Check text roundtripping
|
7 |
|
8 |
im = Image.open(im_name)
|
@@ -10,7 +10,7 @@ def test_roundtrip_text(im_name,extra):
|
|
10 |
info = PngImagePlugin.PngInfo()
|
11 |
info.add_text("TXT", extra)
|
12 |
im.save("test","png",pnginfo=info)
|
13 |
-
|
14 |
|
15 |
|
16 |
def to_bin(data):
|
|
|
2 |
import numpy as np
|
3 |
from PIL import Image, PngImagePlugin
|
4 |
|
5 |
+
def png_encode(im_name,extra):
|
6 |
# Check text roundtripping
|
7 |
|
8 |
im = Image.open(im_name)
|
|
|
10 |
info = PngImagePlugin.PngInfo()
|
11 |
info.add_text("TXT", extra)
|
12 |
im.save("test","png",pnginfo=info)
|
13 |
+
return("test.png","")
|
14 |
|
15 |
|
16 |
def to_bin(data):
|