fzliu / style-transfer

An implementation of "A Neural Algorithm of Artistic Style" by L. Gatys, A. Ecker, and M. Bethge. http://arxiv.org/abs/1508.06576.
1.54k stars 387 forks source link

Some way to set the standard output to lossless .png? #61

Open TomArrow opened 6 years ago

TomArrow commented 6 years ago

It's probably trivial, but I don't know how. TIFF, PNG or BMP would do fine for me.

fzliu commented 6 years ago

With some small code modifications this is certainly possible. You'll want to edit lines 511 and 514; change the ".jpg" into ".png" and pass in some extra arguments into the imsave() function. Scipy uses Pillow for image I/O, so you'll be able to see all of your options here: https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html#png