Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ArtOfWarfare

macrumors G3
Nov 26, 2007
9,560
6,059
You should look at the resulting data in more detail. Seriously. At least do a couple of thought experiments, after familiarizing yourself with what an SVG representation actually looks like.

First, SVG is XML, which is fundamentally a text-based format. There are compressed representations, but support for them is not universal (nor universally required).

Second, a raster image is fundamentally a series of pixels with a color, possibly a different color in each pixel. So a simple alternating pixel pattern, like 0xFFFFFF 0xEEEEEE would have to be represented as a series of unit-length vectors that alternate between two colors. Any translation of the rasterized pattern back to a more vector-like representation requires some pretty clever de-rasterization heuristics.

Exercise #1: Take one line of 60 pixels alternating between two colors, and write out the SVG XML representation of it. Compare that to the PNG representation of the same 60 pixels (you are free to use any recognized PNG compression mechanism).


Next consider a rasterized linear gradient, at an angle of 30 degrees from the vertical. The color changes at every raster line, and also shifts horizontally from line to line. Again, how would you de-rasterize that back to a vector representation that specifies a gradient, angle, and colors?

Repeat the analysis on a radial (circular) gradient. You either have to encode a series of vectors, or de-rasterize back to the parameters for the radial gradient.

For your first scenario, I'd use patterns as described here:

http://www.w3.org/TR/SVG/pservers.html#Patterns

I don't understand your second example.

But I think you may have misunderstood what I was saying... I'm not saying we should de-rasterize existing graphics - we should just make SVGs a more widely supported format and use them extensively going forward.

As far as how to have a PNG fallback for browsers without SVG support:

http://www.w3.org/TR/SVG/backward.html
 
Last edited:

astral125

macrumors 6502
Jul 24, 2011
288
0
Digital images don't have a dpi or ppi, because they are digital. When you print a digital image on paper, then they have dpi. When you display them on a screen, they are displayed at the ppi of the screen.

For example, take an image that is 300x300.

On an iPhone (retina) the image would be displayed at 326ppi. The image would display at 0.92 inches by 0.92 inches.

On an average computer screen, the image would be displayed at 72ppi. The image would be 4.17 inches by 4.17 inches.

So if your eyesight is good enough, you can make out the same level of detail on both screens even though the image is much smaller on an iPhone. You will be more likely to zoom in on an image on an iphone because it is so small, and it will look worse if you zoom it to the point where the image is displayed at 4 x 4 inches. If that is what your client is worried about, then you just need to provide an image with a resolution that is higher in the first place. This is independent of ppi. A good image might be 640 pixels wide so that is uses the entire width of the screen.

Regardless, the conversation should be about how big the client wants the images to display, not the ppi. Once you know the size they want, then you can figure the resolution out pretty easy.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.