FotoJock - fotojockovic.com/fotojock ==================================== Free photo and video tools that run entirely in the browser: HEIC to JPG, an any-to-any image converter, image compression (quality or target size), resizing, an EXIF viewer/remover, and video tools (compress to a quality or an exact size, convert, trim, mute, extract audio, rotate, resize/crop, speed, frames, video to GIF / animated WebP, GIF to MP4, GIF compress/resize/crop/speed/reverse), and AI portrait retouching. No file leaves the device. Our own work (MIT): the app shell, bulk queue, worker pool, ZIP writer, compare viewer and UI; the HEIF/HEIC container reader that feeds HEVC tiles to the browser's WebCodecs decoder (core/heif.js); the EXIF/XMP/ICC reader and the lossless metadata remover (core/meta.js); file type detection; the colour quantiser used for PNG and GIF (median cut + k-means in premultiplied Oklab, Floyd-Steinberg dithering; src-rs/fj-core/src/quant.rs); the GIF frame-difference writer, BMP/ICO writers, the Rust/WebAssembly glue; texts and translations. Rust sources and the build script: /static/tools/fotojock/src-rs/ (build.sh). Everything else that ships to the browser: 1. WebAssembly image core (core/wasm/fj-enc*.wasm, fj-dec.wasm, fj-avif-simd.wasm), compiled from Rust and C: - mozjpeg 4 (via mozjpeg-sys 2.2.3) - IJG licence AND Zlib AND BSD-3-Clause. https://github.com/mozilla/mozjpeg "This software is based in part on the work of the Independent JPEG Group." - libwebp 1.x (via libwebp-sys 0.14.4) - BSD-3-Clause (Google). https://chromium.googlesource.com/webm/libwebp - oxipng 10.2.1 - MIT. https://github.com/shssoichiro/oxipng - libdeflate (via libdeflater 1.26.1) - MIT / Apache-2.0. https://github.com/ebiggers/libdeflate - fast_image_resize 6.1.0 - MIT OR Apache-2.0. https://github.com/Cykooz/fast_image_resize (Magic Kernel Sharp 2021 kernel: John Costella, https://johncostella.com/magic/ - formula as in libvips) - image 0.25 with png, gif, tiff, image-webp, zune-jpeg, qoi decoders - MIT OR Apache-2.0 (zune-*: also Zlib). https://github.com/image-rs/image - ravif 0.13.0 (BSD-3-Clause) and rav1e 0.8.1 (BSD-2-Clause) for AVIF. https://github.com/kornelski/cavif-rs, https://github.com/xiph/rav1e ; avif-serialize (BSD-3-Clause), v_frame and av1-grain (BSD-2-Clause). - Smaller Rust crates, all MIT and/or Apache-2.0 (some also Zlib, BSD, Unlicense or CC0): adler2, bitflags, bytemuck, color_quant, crc32fast, fdeflate, flate2, half, hashbrown, indexmap, miniz_oxide, moxcms (BSD-3/ Apache-2.0), pxfm (BSD-3/Apache-2.0), num-*, rgb, rustc-hash, simd-adler32, thiserror, weezl, zerocopy, arrayvec, itertools, nom, rayon-core (not used for threads here), imgref, loop9, y4m and their dependencies. - wasi-libc (WASI SDK 25) - Apache-2.0 WITH LLVM-exception / MIT / CC0. https://github.com/WebAssembly/wasi-libc No GPL or AGPL code is included (no libimagequant/pngquant, no gifski, no x264). 2. HEIC fallback decoder - LGPL-3.0, a separate file loaded only when the browser cannot decode HEIC itself: lgpl/libheif/libheif.js + libheif.wasm = libheif-js 1.23.5 (Kiril Vatev), an Emscripten build of libheif 1.23 (struktur AG) with libde265 (LGPL-3.0, HEVC), dav1d (BSD-2-Clause) and OpenJPEG (BSD-2-Clause). Unmodified. Licence text: lgpl/libheif/LICENSE. Source code: https://github.com/catdad-experiments/libheif-js (build scripts) https://github.com/strukturag/libheif (libheif) https://github.com/strukturag/libde265 (libde265) You may replace these two files with your own build of the same libraries. 3. Sample pictures (samples/*, resized and re-encoded; EXIF in sample-gps.jpg and sample-iphone.heic is made up for the demo). Wikimedia Commons, CC0 1.0: samples/sample-photo.*, sample-gps.jpg, sample-scan.tif, sample-anim.gif - "Agraulis vanillae at Isla Margarita.jpg" https://commons.wikimedia.org/wiki/File:Agraulis_vanillae_at_Isla_Margarita.jpg samples/sample-iphone.heic - "Juan Griego Sunset.jpg" https://commons.wikimedia.org/wiki/File:Juan_Griego_Sunset.jpg samples/sample-graphic.png (a screenshot of FotoJock) and samples/sample-logo.svg: our own work. 4. Font: Inter 4.001 (Rasmus Andersson et al.), SIL Open Font License 1.1. The site's own subsets in /static/fonts, plus FotoJock's small subsets in fonts/ (accented Latin, Greek, arrows) made from the same font. No Google Fonts. 5. Language picker and flags: /static/tools/common/i18n.js (our own work; national flags are public-domain symbols). Translations: our own work. 6. Map links in the EXIF viewer open openstreetmap.org or Google Maps in a new tab only when you click them; no map tiles or other third-party resources are loaded by the page. 7. Video tools. Video is decoded and encoded by the browser's own WebCodecs (usually the device's hardware). - Mediabunny 1.61.6 (Vanilagy and contributors) - MPL-2.0, unmodified file: vendor/mediabunny/mediabunny.min.js (the published "mediabunny.min.cjs" bundle, renamed). Licence: vendor/mediabunny/LICENSE. Source code: https://github.com/Vanilagy/mediabunny (tag v1.61.6), https://www.npmjs.com/package/mediabunny - Our own work (MIT): the video worker (core/vworker.js: bitrate/target-size planning with re-encode passes, moov-first "fast start" rewrite, OPFS streaming output, HDR to SDR through a canvas, GIF/WebP pipelines), the compare player and trim timeline (core/vstage.js), the video tool UI (tools/video.js, core/video.css), and fj-gif.wasm (src-rs/fj-gif: video GIF encoder with one palette per clip, Floyd-Steinberg dithering in Oklab and temporal transparency; GIF decoder with frame compositing). Uses the gif crate 0.14 (MIT OR Apache-2.0) and rustc-hash (MIT OR Apache-2.0). Animated WebP uses libwebp (BSD-3-Clause) from fj-enc.wasm (see 1). No GPL or AGPL code: no x264/x265, no gifski, no libimagequant, no default ffmpeg.wasm core. 8. Optional LGPL video modules - separate files, loaded only when a file or setting needs them, never bundled with the rest. You may replace each of them with your own build of the same sources. - lgpl/fj-av/fj-av.js + fj-av.wasm: our own LGPL-only build of FFmpeg n7.1.1 libavformat/libavcodec/libavutil/ libswscale/libswresample (LGPL-2.1-or-later), compiled with Emscripten 4.0.10, plus our small C bridge. Used for containers and codecs the browser cannot open (AVI, WMV/ASF, FLV, MPEG-PS/VOB, MPEG-4 Part 2/DivX/Xvid, WMV/VC-1, MJPEG, MPEG-1/2, ProRes, DV, HEVC where the browser has no HEVC decoder, WMA, AC-3, DTS, AMR ...). Configured WITHOUT --enable-gpl / --enable-nonfree, no external libraries ("License: LGPL version 2.1 or later"). Exact configure line, build script and bridge source: lgpl/fj-av/src/ (CONFIGURE.txt, build.sh, bridge.c). Licence: lgpl/fj-av/COPYING.LGPLv2.1. FFmpeg source: https://github.com/FFmpeg/FFmpeg/tree/n7.1.1 (https://ffmpeg.org/releases/ffmpeg-7.1.1.tar.xz). - lgpl/mediabunny-mp3/: @mediabunny/mp3-encoder 1.61.6 (MPL-2.0 wrapper) with a WebAssembly build of LAME 3.100 (LGPL-2.0-or-later, https://lame.sourceforge.io/), used only for MP3 output when the browser has no MP3 encoder. Source: https://github.com/Vanilagy/mediabunny/tree/main/packages/mp3-encoder and https://sourceforge.net/projects/lame/files/lame/3.100/ . "MP3 encoding by LAME, https://lame.sourceforge.io". - lgpl/mediabunny-aac/: @mediabunny/aac-encoder 1.61.6 (MPL-2.0 wrapper) with FFmpeg's native AAC encoder (libavcodec, LGPL-2.1-or-later, configured with --disable-everything --enable-encoder=aac, no GPL parts), used only when the browser has no AAC encoder (e.g. Chrome on Linux, Firefox). Source: https://github.com/Vanilagy/mediabunny/tree/main/packages/aac-encoder - lgpl/mediabunny-ac3/: @mediabunny/ac3 1.61.6 (MPL-2.0 wrapper) with FFmpeg's AC-3/E-AC-3 decoder and encoder (libavcodec, LGPL-2.1-or-later), used only for videos with Dolby Digital sound. Source: https://github.com/Vanilagy/mediabunny/tree/main/packages/ac3 Each folder holds the MPL-2.0 text and, where applicable, the LGPL text. 9. Sample videos (samples/sample-video.*, demo-video.jpg): our own, made from the CC0 butterfly photo (section 3) with a synthesised sound. 10. AI portrait retouch (/fotojock/retouch). Our own work (MIT): the whole retouching engine and UI (tools/retouch.js, retouch/*.js: face windows, skin/beard/make-up masks, frequency-separation layers, spot finder and texture-transplant heal, dark circles, eye bags, eye whites, iris, teeth, shine, backdrop smoothing, live preview and full-resolution compositing). It is classic image processing on the device; no face is redrawn by a generative model. Models (run with ONNX Runtime Web; they download once, about 25 MB with the runtime): - YuNet face detector, OpenCV Zoo "face_detection_yunet_2026may.onnx" (Shiqi Yu et al.), MIT. retouch/models/yunet.onnx, licence: retouch/models/LICENSE-YuNet.txt. https://github.com/opencv/opencv_zoo - MediaPipe Face Landmarker, face landmark network (478 points with irises) from face_landmarker.task (Google), Apache-2.0 (model card "MediaPipe Face Mesh V2"). Converted by us from TFLite to ONNX, weights stored as float16: retouch/models/face-landmarks-f16.onnx. - MediaPipe Selfie Multiclass Segmentation 256x256 (Google), Apache-2.0 (model card "Multiclass Segmentation"). Converted by us to ONNX, weights stored as float16: retouch/models/selfie-mc-f16.onnx. Licence for both: retouch/models/LICENSE-MediaPipe-Apache-2.0.txt. https://ai.google.dev/edge/mediapipe - SFace face recognition, OpenCV Zoo "face_recognition_sface_2021dec.onnx" (Yaoyao Zhong, SFace; ONNX by Chengrui Wang), Apache-2.0. Only for the optional "Same person, same settings" (downloads on first use, about 19 MB). Weights stored by us as float16: retouch/models/sface-f16.onnx; licence: retouch/models/LICENSE-SFace.txt. https://github.com/opencv/opencv_zoo/tree/main/models/face_recognition_sface - ONNX Runtime Web 1.30.0 (Microsoft), MIT: vendor/ort/ (LICENSE.txt, ThirdPartyNotices.txt). - Backdrop cleaning also uses the site's shared cut-out module /static/tools/segment/ (BiRefNet, MIT; IS-Net, Apache-2.0) for the subject's outline; see its own CREDITS.txt. Sample portrait (samples/sample-portrait.jpg, demo-portrait.jpg, og/retouch.jpg; resized, demo retouched by this tool): "Smile with Freckles (Unsplash).jpg" by Gabriel Silvério, Wikimedia Commons, CC0 1.0. https://commons.wikimedia.org/wiki/File:Smile_with_Freckles_(Unsplash).jpg Before/after pictures of the single-purpose retouch pages (og/.jpg and samples/demo-.jpg; cropped and resized from Wikimedia Commons photos; the "after" side is this tool's own output, nothing else was changed): - teeth-whitening: "Andrea Ivory - Headshot 23.jpg" by Andrea Ivory, CC BY-SA 4.0 (https://creativecommons.org/licenses/by-sa/4.0/). https://commons.wikimedia.org/wiki/File:Andrea_Ivory_-_Headshot_23.jpg The cropped before/after pictures are shared under the same licence, CC BY-SA 4.0. - blemish-remover: "Tattooed woman with dreads.jpg" by Miguel Discart, CC BY-SA 2.0 (https://creativecommons.org/licenses/by-sa/2.0/). https://commons.wikimedia.org/wiki/File:Tattooed_woman_with_dreads.jpg The cropped before/after pictures are shared under the same licence, CC BY-SA 2.0. - backdrop-cleaner: "Ellie-Rose (6261219241).jpg" by Lies Thru a Lens, CC BY 2.0 (https://creativecommons.org/licenses/by/2.0/). https://commons.wikimedia.org/wiki/File:Ellie-Rose_(6261219241).jpg - skin-smoothing, remove-dark-circles, face-slimming: "Heran Darwin Headshot.jpg" by Kramej08, CC0 1.0. https://commons.wikimedia.org/wiki/File:Heran_Darwin_Headshot.jpg - wrinkle-remover: "Karen Elder (Unsplash).jpg" by zjtcpts (Capturing the human heart.), CC0 1.0. https://commons.wikimedia.org/wiki/File:Karen_Elder_(Unsplash).jpg - remove-double-chin (also its sample photo, samples/sample-double-chin.jpg, unchanged): "Narayana Ramachandran.jpg" by Vinod Divakaran (Doha Stadium Plus), CC BY 3.0 (https://creativecommons.org/licenses/by/3.0/). https://commons.wikimedia.org/wiki/File:Narayana_Ramachandran.jpg 11. "Compress to X KB" quality metric (core/kbfit.js): a JavaScript port of SSIMULACRA2 by Jon Sneyers / Cloudinary, as published in libjxl (tools/ssimulacra2.cc), BSD 3-Clause License, Copyright (c) the JPEG XL Project Authors. The port follows the reference Python implementation (pip package "ssimulacra2", BSD 3-Clause) and matches it to within 0.005. https://github.com/cloudinary/ssimulacra2 · https://github.com/libjxl/libjxl 12. AI edit tools (remove background, remove object, extend image). Our own work (MIT): tools/cutout.js, tools/eraser.js, tools/extend.js, ai/*. The models run through the site's shared modules and are credited there: - /static/tools/segment/CREDITS.txt: BiRefNet (MIT), IS-Net (Apache-2.0), ONNX Runtime Web (MIT). - /static/tools/inpaint/CREDITS.txt: LaMa (Apache-2.0), MI-GAN (MIT), Moebius (Apache-2.0 code / MIT weights), SDXL-VAE fp16-fix (MIT), ONNX Runtime Web (MIT); the experimental "HQ" remover RORem-4S (Li et al., CVPR 2025; weights Apache-2.0 tag on the Stable Diffusion XL inpainting base, CreativeML Open RAIL++-M: its use restrictions (Attachment A, /static/tools/inpaint/licenses/LICENSE-SDXL-OpenRAIL++-M.txt) apply to everyone who uses HQ). Sample photos, Wikimedia Commons, CC0 1.0: samples/sample-eraser.jpg and demo-eraser.jpg from "Dog owner walking his dogs on the beach..JPG"; samples/sample-extend.jpg and demo-extend.jpg from "Cloudy Skies Over Mountains (Unsplash).jpg"; demo-cutout.jpg from the portrait sample of section 10 ("Smile with Freckles (Unsplash).jpg", CC0). 13. Upscale image (/fotojock/upscale-image and its 4 sister pages). Our own work (MIT): tools/upscale.js, ai/upw.js. The models run through the site's shared upscaler module and are credited there in full: - /static/tools/upscale/CREDITS.txt: waifu2x swin_unet photo models by nagadomi (MIT); 4xBHI_realplksr_dysample_real and 4xBHI_dat2_real by Philip Hofmann, CC BY 4.0 (creativecommons.org/licenses/by/4.0/; converted to ONNX, fp16 weights); ONNX Runtime Web (MIT). Sample photo samples/sample-upscale.jpg and demo-upscale.jpg: the CC0 butterfly photo of section 3, made small (480 px, JPEG quality 68) to show the upscaler; the demo is our own output. 14. Crop / rotate / flip (/fotojock/crop-image and its 5 sister pages). Our own work (MIT): tools/crop.js, tools/cropbox.js, tools/cropgeo.js, tools/cropw.js, tools/cropjt.js, src-rs/fj-jt. Lossless JPEG crops, turns and flips run in core/wasm/fj-jt.wasm, built from mozjpeg (BSD-style and IJG licences, the same library as our JPEG encoder), including its transupp.c (the code behind jpegtran), which is distributed under the IJG licence: "this software is based in part on the work of the Independent JPEG Group". 15. New tools batch (2026-10-18). Our own work (MIT): tools/printcalc.js, tools/printsizes.js, tools/audio.js, tools/fx.js, core/fx.js, tools/recolor.js (+ their CSS). core/fx.js copies the colour-look formulas of retouch/tone.js (our own). Palettes in core/fx.js: PICO-8 (16 colours, published by Lexaloffle as a palette definition) and the 4 Game Boy greens, used as colour values (facts), no artwork. Audio: the existing Mediabunny / LAME / AAC / libav modules (section 9 / lgpl/), nothing new bundled. Samples: samples/sample-audio.* and demo-audio.jpg are our own synthesised tune; demo-pixel.jpg and demo-bw.jpg are made from the CC0 butterfly photo (section 3); samples/sample-recolor.jpg and demo-recolor.jpg: "Red car toy.jpg", Wikimedia Commons, CC0 1.0 (resized, metadata removed).