|
|
|
|
|
by willis936
1723 days ago
|
|
This is why I like things like svg for pure gradient graphics. Uncompressed plaintext can be used to render all RGB colors with a similar filesize as png. I'll see if I can come up with a clever way do it without having to resort to tricks that move the goalposts (such as having repeated colors). Okay I think I got pretty close. The png export doesn't have 16.7 million colors, so there must be some error in my logic. 1370 bytes as a human readable plaintext file. 711 bytes as a 7-zip. 658 bytes as a usable compressed svgz file. 159936 bytes as a png. <?xml version="1.0" encoding="UTF-8"?>
<svg width="256" height="65536" version="1.1" viewBox="0 0 256 65536" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<defs>
<linearGradient id="a" x2="256" y1="32768" y2="32768" gradientUnits="userSpaceOnUse">
<stop stop-color="#f00" offset="0"/>
<stop stop-color="#ff0" offset=".166666667"/>
<stop stop-color="#0f0" offset=".333333333"/>
<stop stop-color="#0ff" offset=".5"/>
<stop stop-color="#00f" offset=".666666667"/>
<stop stop-color="#f0f" offset=".833333333"/>
<stop stop-color="#f00" offset="1"/>
</linearGradient>
<linearGradient id="b" x1="128" x2="128" y1="0" y2="65536" gradientUnits="userSpaceOnUse">
<stop offset="0"/>
<stop stop-color="#808080" stop-opacity="0" offset=".5"/>
<stop stop-color="#fff" offset="1"/>
</linearGradient>
</defs>
<metadata>
<rdf:RDF>
<cc:Work rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
</cc:Work>
</rdf:RDF>
</metadata>
<rect width="256" height="65536" fill="url(#a)" stroke-width="24" style="mix-blend-mode:normal"/>
<rect width="256" height="65536" fill="url(#b)" stroke-width="24" style="mix-blend-mode:normal"/>
</svg>
|
|