zi2zi icon indicating copy to clipboard operation
zi2zi copied to clipboard

image saving problem in font2img.py

Open handspeaker opened this issue 7 years ago • 2 comments

hi @kaonashi-tyc , When I use font2img.py to generate jpg format images, I find the generated images have some noise around the strokes. I think it will degrade the training result more or less. Then after several experiments I find the problem lies in PIL image save function. Exactly in font2img.py line 87

e.save(os.path.join(sample_dir, "%d_%04d.jpg" % (label, count)))

I change this line by

e.save(os.path.join(sample_dir, "%d_%04d.jpg" % (label, count)), quality=100)

And the noise disappear.

handspeaker avatar May 02 '17 03:05 handspeaker

I wonder if program accepts PNG? If so, using PNG is better since PNG is lossless format.

roytam1 avatar May 02 '17 13:05 roytam1

@handspeaker I will merge this once I tested it out on the exported model. The reason jpg is chosen is because it is inherited from the reference repo.

kaonashi-tyc avatar May 03 '17 01:05 kaonashi-tyc