Image-processing methodology

Dimensions and quality

Dimensions are measured in pixels. A locked aspect ratio calculates the second dimension from the original proportions and rounds to a whole pixel. JPEG and WebP quality values are instructions to the browser encoder, not percentages of detail retained.

File-size comparison

Input and output sizes come from the actual file and output blob. Percentage reduction is (original bytes − output bytes) ÷ original bytes × 100. If output is larger, the interface reports an increase.

Metadata checks

Container inspection detects supported EXIF, XMP, text, and application metadata without displaying their personal contents. Cleanup creates a new image from decoded pixels and inspects the encoded output again. It does not conceal content inside pixels.

Audio conversion and cuts

Audio is decoded by the browser at 48 kHz. WAV output rounds each sample to signed 16-bit PCM, clips values outside −1 to 1, and interleaves one or two channels. Start and end times round to decoded sample positions. No dithering, normalization, fades, or quality restoration is applied. The MP3 decoder may handle encoder delay differently across browsers.

Verification

The project includes structural unit tests and real browser image conversions. A passing automated test is not proof of support on every phone. The README lists the actual test results, limitations, and manual checks still needed.

PDF processing

Structural compression uses object streams with no image downsampling. Merge and Split copy selected pages into new PDFs. Rewritten files are parsed again; page dimensions, extracted text and rendered page samples at a maximum 300-pixel edge are compared with the originals. This is a basic consistency check, not an exhaustive fidelity guarantee. Resource limits can reject otherwise valid PDFs. Forms, signatures, annotations, layers, bookmarks, tagged documents and other unsupported structures are rejected before rewriting.