Photo to Sketch (fotojockovic.com/sketch) - credits and licences ================================================================= Turns photos into pencil drawings in two styles (Detailed pencil, Classic pencil) and saves them as print and laser engraving files. Everything runs in the browser; no photo leaves the device. Our own work (MIT licence): index.html, app.js, i18n.js and lang/*.js, export.js (PNG writer with 1-bit and pHYs, Floyd- Steinberg dithering, JPEG density), engine/model-worker.js, engine/post-worker.js, engine/modes.js and engine/algos.js (from our own Sketch Lab prototype, unchanged), ../engraving/handoff.js, the icons and the texts. engine/algos.js and engine/modes.js re-implement published methods (ideas only, no code copied): - Edge tangent flow from the smoothed structure tensor: T. Brox et al., "Nonlinear structure tensors", 2006; J. E. Kyprianidis, J. Doellner, "Image abstraction by structure adaptive filtering", 2008. - H. Kang, S. Lee, C. K. Chui, "Coherent Line Drawing", NPAR 2007; "Flow-Based Image Abstraction", TVCG 2009. - C. Lu, L. Xu, J. Jia, "Combining Sketch and Tone for Pencil Drawing Production", NPAR 2012 (tone histogram, texture rendering H^beta, stroke map). - B. Cabral, L. Leedom, "Imaging Vector Fields Using Line Integral Convolution", SIGGRAPH 1993; X. Mao et al., "Automatic generation of pencil drawing using LIC", 2001 (pencil strokes and hatching along the flow). - R. W. Floyd, L. Steinberg, "An adaptive algorithm for spatial greyscale", 1976 (dithering in export.js). Models (both MIT, weights converted by us to ONNX with int8 weights and fp32 compute; served as models/*/NN.bin parts): 1. Informative Drawings - C. Chan, F. Durand, P. Isola, "Learning to generate line drawings that convey geometry and semantics", CVPR 2022. https://github.com/carolineec/informative-drawings - MIT (c) 2022 Caroline Chan. "anime" style weights via huggingface.co/x-Liola-x/informative-drawings-onnx (MIT). models/anime-i8-v1 (4.3 MB). 2. DexiNed - X. Soria, E. Riba, A. Sappa, "Dense Extreme Inception Network: Towards a Robust CNN Model for Edge Detection", WACV 2020. https://github.com/xavysp/DexiNed - MIT (c) 2019 Xavier Soria Poma. Weights: huggingface.co/kornia/dexined DexiNed_BIPED_10.pth (MIT). Our export outputs the fused map and the average of its scales; the 6-channel fusion convolution is padded to 16 channels (works around an ONNX Runtime Web WebGPU issue); int8 only for layers with at least 200k weights. models/dexined-i8-v1 (38.8 MB in two parts). MIT licence text (both models): Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Used from other parts of this site (not copied): - ONNX Runtime Web 1.30 (MIT, Microsoft): /static/tools/segment/ort/. - Background removal: the site's shared cut-out module /static/tools/segment/ (BiRefNet MIT, IS-Net Apache-2.0); see /static/tools/segment/CREDITS.txt. - ZIP writer: /static/tools/fotojock/core/zip.js (our own, MIT). - Fonts: /static/tools/common/fonts/ (SIL Open Font License). Sample photos (samples/*.jpg, resized) and the pictures made from them (samples/hero.jpg, style-*.jpg, og.jpg, /static/img/apps/sketch*.webp are this tool's own output on the portrait photo). All Wikimedia Commons, CC0 1.0: samples/portrait.jpg: "Long-haired woman laughing (Unsplash).jpg" by Brooke Cagle; https://commons.wikimedia.org/wiki/File:Long-haired_woman_laughing_(Unsplash).jpg samples/dog.jpg: "Earnest dog in the grass (Unsplash).jpg" by Rodion Kutsaev; https://commons.wikimedia.org/wiki/File:Earnest_dog_in_the_grass_(Unsplash).jpg samples/gothic.jpg: "Dublin, Ireland (Unsplash usS0OOexmhY).jpg" by Ian Schneider; https://commons.wikimedia.org/wiki/File:Dublin,_Ireland_(Unsplash_usS0OOexmhY).jpg samples/car.jpg: "Vintage blue volkswagen beetle (Unsplash).jpg" by Scott Umstattd; https://commons.wikimedia.org/wiki/File:Vintage_blue_volkswagen_beetle_(Unsplash).jpg