The images I get from Dall-e-3 API are image/png, but utilize zero compression. All files have exactly the same size of ~3MB (1024x1024), which roughly corresponds to 1024x1024x24 bit color + the PNG header.
Obviously the client can optimize the image, but this is really an unnecessary burden on client pieplines, network etc. I understand you want to provide the best quality, but it would be so much nicer to:
A. provide output format parameter to get a compressed image/jpeg instead
B. provide a thumbnail URL, so that the image can be directly shown on a client
DALL-E-3 is lossless.
It is compressed.
memory size: 3145768 bytes
disk size: 1700667 bytes
PNG uses the deflate compression algorithm.
Lossy compression? Bing is thataway —> (although a jpg or webp with quality specification as you suggest certainly could have utility to some)
That’s the most recent dall-e-3 image that I obtained. I’m getting the b64_json, but you are correct in my oversight that in having made it into a pillow image object first, I’ve given myself the ability to save the even more bloated base64 to the disk compression that came for free - and attach metadata (or be Bing with creepy encrypted watermarking).
You can get an interesting undocumented part of the beta API return out, generation time, and compare that to response time. It would take some thinking for me to come up with a “transfer rate graph” for the 8 seconds a connection is open. My initial test reminded me that this PC is on WiFi where the download uncompressed would take 0.45 seconds.
Ha, I modified my code to request
b64_json instead url and when I decode it, the result is a normally compressed image!
So let’s conclude this is a bug with PNGs saved to temporary URLs only. I modified the title to be more clear.
The b64_json image represents web/p, not png.
image.png: RIFF (little-endian) data, Web/P image, VP8 encoding, 1024x1024, Scaling: [none]x[none], YUV color, decoders should clamp
I couldn’t specify the desired format and couldn’t find out until I decoded it.
Has this changed in some way lately? I noticed that images I generated before Dec 6 were roughly 175kb in size, now they are all 3mb. What am I missing? I’ve tried compressing them with Pillow but the results are poor quality.