SVG:
SVG 代表可缩放矢量图形。 SVG 文件使用.svg扩展名。它是由路径组成的矢量图像。 SVG 文件是可编辑的,主要用于像素密度高的设备。
例子 :
代码:
输出:
JPEG:
JPEG 代表联合图像专家组。对于 JPEG 图像使用的扩展名是.jpg和.jpeg 。它使用有损压缩算法。它是由像素组成的光栅图像。 JPEG 图像质量在缩放图像时会降低。
例子 :
SVG 和 JPEG 的区别:
S.NO | SVG | JPEG | |||
---|---|---|---|---|---|
1. | It stands for Scalable Vector Graphics. | It stands for Joint Photographic Experts Group. | |||
2. | It is a vector image. | It is a raster image. | |||
3. | It’s quality doesn’t decrease on zooming. | Image quality decreases on zooming. | |||
4. | It is made up of paths. | It is made up of fixed no of pixels. | |||
5. | SVG files are editable. | JPEG files are not editable. | 6. | Extensions used is .svg. | Extension used are .jpg and .jpeg. |
7. | Mostly used for devices with high pixel density. | It is mostly used in photography. |