mpchadwick / pngarbage

Scan a web page for garbage PNGs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pngarbage

A CLI utility to scan web pages for garbage PNGs.

What?

Improper image format usage can be a serious concern for frontend web performance. PNGs can be particularly problematic as they are typically much larger than JPEGs.

pngarbage will scan a URL and attempt to identify cases where PNGs are used when they really shouldn't be.

How?

Currently, pngarbage will flag a png as "garbage" if it has no transparent pixels. Alpha transparency is one of the primary reasons to use a PNG and if a PNG doesn't have any transparent pixels, there's a high likelihood that JPEG could have been used, resulting in serious savings.

Usage

Download the latest binary from the releases page. Then, simply specify the URL to scan and run it

➜  ./pngarbage -url="http://localhost:8080"
===========================
> pngarbage
===========================
Checking:  http://localhost:8080
Number of pngs:  2
http://localhost:8080/sample.png  is garbage! Content-Length:  31520

About

Scan a web page for garbage PNGs


Languages

Language:Go 98.6%Language:Makefile 1.4%