Does Image Compression Remove EXIF Data?

By Michael Lip · Updated 2026-10-28

Yes, at krzen.com it does. The compressor reads your file with FileReader, draws it on a canvas, and exports a new file with canvas.toBlob. That export writes new pixels only. EXIF fields such as camera model, date, and GPS location are not copied to the output.

The code path

The compressor never edits your file. It decodes the file, copies the pixels into a new canvas, and encodes a new file from that canvas. These lines from assets/app.js show the path:

70:    var reader = new FileReader();
103:    var canvas = document.createElement('canvas');
107:    ctx.drawImage(originalImg, 0, 0, dims.w, dims.h);
110:    canvas.toBlob(function(blob) {

A canvas holds pixels only. It has no field for camera model, lens, date, copyright, or GPS position. toBlob therefore writes a file with the encoded image and no EXIF block.

What EXIF holds

EXIF is the metadata block that a camera writes into a photo. It can hold the camera make and model, the lens, the exposure settings, the capture date and time, the software name, the copyright field, and the GPS coordinates of the place where the photo was taken.

The GPS field is the one with a privacy cost. A photo taken at home can publish the street address of the home. Compression through a canvas removes that field along with the rest.

What stays

The visible pixels stay. The width and height of the output follow your resize setting, and the output format follows your selection. If you need the capture date or the copyright line, keep a copy of the original file. The compressed file will not carry them.

The image optimization checklist counts a stripped metadata block as a saving. The compressor does the stripping as a side effect of the canvas export.

Michael Lip

Made by Michael, one person and a lot of coffee.

If krzen has helped you, you can buy me a coffee. It honestly makes my day, and I read every note that comes with one.

Buy me a coffee · $5via PayPalCard, any amount or monthlySponsor on GitHubmonthly or one-timeWhy I ask
By the same builder: GitHub — theluckystrike BeLikeNative — Grammar AI EarlyThunder — Dev Blog Bug Bounty Reality Zovo — AI Dev Tools