Skip to content


PNG Image Optimization

การทำให้ขนาดของรูปภาพมีขนาดเล็กลง เป็นส่วนหนึ่งที่จะทำให้เวปไซต์ของเราโหลดไวขึ้น อีกทั้งใช้แบนวิธที่น้อยลงทำให้เซอร์เวอร์ของเราใช้งานได้อย่างมีประสิทธิภาพเพิ่มมากขึ้น ซึ่งการทำให้ไฟล์รูปแบบ PNG มีขนาดน้อยลงมีวิธีทำดังต่อไปนี้

จาก WikiBall

เนื้อหา



Optimize ด้วย OptiPNG หรือ pngcrush


PNGcrush

pngcrush เป็นโปรแกรมที่มีอยู่แล้วใน ubuntu synapticสามารถใช้ apt-get เอามาลงได้เลย

$ pngcrush -rem allb -brute -reduce original.png optimized.png

โดยพารามิเตอร์ต่างๆ มีความหมายดังต่อไปนี้

  • -rem allb — remove all extraneous data. Except transparency and gamma; to remove everything except transparency, try -rem alla
  • -brute — attempt all optimization methods. Requires more processing time and may not improve optimization by much.
  • -reduce — eliminate unused colors and reduce bit-depth. ถ้าเป็นไปได้


Optipng

$ optipng -o7 org.png
  • -o7 — optimize ระดับสูงสุด โดยเริ่มจากระดับที่ 0 – 7


Optimize with Smush.it

ย่อรูปด้วยโปรแกรม smush.it ซึ่งเป็นโปรแกรมสำหรับ Firefox
[[1]]


reference

รับข้อมูลจาก (Reference) :

จาก WikiBall : http://wiki.memoball.info/index.php/PNG_Image_Optimization

Posted in Graphics, Web Application. Tagged with , .

0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.