Codementor Events

# Stop using PNGs! Use Vector drawable. Why?

Published Sep 20, 2017
# Stop using PNGs! Use Vector drawable. Why?

What is Vector drawable?

Vector drawables allow you to replace multiple png assets with a single vector graphic, defined in XML. While previously limited to Lollipop and higher devices, both VectorDrawable and AnimatedVectorDrawable are now available through two new Support Libraries support-vector-drawable and animated-vector-drawable, respectively.

Reasons of using vector drawable

• The important point of vector graphics is the power of scalability. If we try to enlarge the pixel based image, it only enlarge the size of the squares making up the image area and pixel based image will be jagged. If we consider the vector image, it will remain in its best quality.
• Data can be represented in original resolution without generalization.
• Graphical outputs of the images are more pleasing than the created as raster image.
• In some data like hard copy maps, no data conversion is needed.
• Every lines in a vector graphics represents different and distinct object so each object can be edited as many times. For example, if we take art file with a circle in back ground. It can be opened any time even days later and change circle to a square. It will be at their best quality.
Another very important reason of using vector graphics rather than raster is their size. Vector objects are much smaller than raster image format. If we have full size image to update, the vector file might only take few kilobytes of space on your system, where the same image in medium resolution bitmap format might not place on CD ROM.

read more....

https://medium.com/the-android-guy/stop-using-pngs-use-vector-drawable-why-8ca68bed5335

Discover and read more posts from Balram Pandey
get started
post commentsBe the first to share your opinion
Show more replies