File talk:Sq3 purplewhitepurple.svg

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Adobe generated files[edit]

The category Colours square (the correct name would be "Color squares") contains about 60 files of extremly simple structure, as about 15 bicolor and about 45 tricolor or squares.

1st size: 182 071 bytes
2nd size: 005 368 bytes
3rd size: 0000252 bytes
4th size: 0000208 bytes

1st version: Adobe Illustrator inserted huge blocks of CDATA, which is of no use in the Wikimedia.
2nd size: Removing tha CDATA blocks reduces file sizes to about 2%, the images are identical - just faster to load. They contain still a lot of redundant coding.

3rd version: Trying to create files of reasonable size by manual coding reduces the file size again. The two examples are not at all minimized, just drawn as it seems useful.
4th version: With some simplifications a few bytes less are necessary.
5th version: A little bit smaller.

The "File History" contains all the different versions.

The coding of the 4th one looks like that: 000 (the librsvg does not need anymore the encoding)

 <?xml version="1.0" encoding="UTF-8"?>
 <svg xmlns="http://www.w3.org/2000/svg"
 width="200" stroke="#000" stroke-width="2">
 <path fill="#FFF" d="M1,199H199V1z"/>
 <path fill="#33A02C" d="M1,199V1H199z"/>
 </svg>
1st size: 179 806 bytes
2nd size: 003 062 bytes
3rd size: 0000272 bytes
4th size: 0000247 bytes
5th size: 0000219 bytes

and (working around the librsvg bug)

<?xml version="1.0"?>
<svg xmlns="http://www.w3.org/2000/svg" width="200"
height="200" stroke="#000" stroke-width="2">
<path fill="#A45BAA" d="m1,1h198v198H1z"/>
<path fill="#FFF" d="m1,126v73h73L199,74V1h-73z"/>
</svg>
Outer colors black

When the picture consists just of a colored stroke within a black square, it can be coded quite simple like

<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg"
width="200" height="200">
<path d="M0,0V200H200V0"/>
<path fill="#33A02C" d="M2,125v73h73L198,75V2H125"/>
</svg>

(From 180.842 to 195 bytes)

from 180 038 to 274 bytes

For three different colors it may look like

<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="200"
height="200" stroke="#000" stroke-width="2">
<path fill="#FFF" d="M1,1V199H199V1z"/>
<path fill="#0571B0" d="M1,126V1H126z"/>
<path fill="#33A02C" d="M74,199H199V73z"/>
</svg>
unbordered

Without the black frame/border, it can be coded quite simple like

 <?xml version="1.0" encoding="UTF-8"?>
 <svg xmlns="http://www.w3.org/2000/svg"
 width="200" height="200">
 <path fill="#BCBEB0" d="M0,0V200H200V0"/>
 <path fill="#A1D078" d="M0,0V200L200,0"/>
 </svg>