[{"data":1,"prerenderedAt":111},["ShallowReactive",2],{"blog-post-imagemagick-optimize-images":3,"recent-posts":67},{"id":4,"uid":5,"url":6,"type":7,"href":8,"tags":9,"first_publication_date":10,"last_publication_date":10,"slugs":11,"linked_documents":13,"lang":14,"alternate_languages":15,"data":16},"av7XDxIAACkAmDyy","imagemagick-optimize-images",null,"blog_posts","https:\u002F\u002Fmarks-personal-website.cdn.prismic.io\u002Fapi\u002Fv2\u002Fdocuments\u002Fsearch?ref=awdlAxIAACcAJjXm&q=%5B%5B%3Ad+%3D+at%28document.id%2C+%22av7XDxIAACkAmDyy%22%29+%5D%5D",[],"2026-11-25T22:45:23+0000",[12],"imagemagick-how-to-optimize-images",[],"en-us",[],{"title":17,"date":23,"description":24,"image":29,"content":39},[18],{"type":19,"text":20,"spans":21,"direction":22},"heading1","ImageMagick: How to Optimize Images",[],"ltr","2026-11-25",[25],{"type":26,"text":27,"spans":28,"direction":22},"heading2","Learn how to optimize images for the web using ImageMagick",[],{"dimensions":30,"alt":20,"copyright":6,"url":33,"id":34,"edit":35},{"width":31,"height":32},1280,720,"https:\u002F\u002Fimages.prismic.io\u002Fmarks-personal-website\u002FUCjpRnL5HVuoeJpz_imagemagick-optimize-images.png?auto=format,compress","UCjpRnL5HVuoeJpz",{"x":36,"y":36,"zoom":37,"background":38},0,1,"transparent",[40,44,48,51,54,57,60,64],{"type":41,"text":42,"spans":43,"direction":22},"paragraph","Before we start, make sure you have ImageMagick installed on your computer and your photo ready in a folder. If you don't have it yet, run this command:",[],{"type":45,"text":46,"spans":47,"direction":22},"preformatted","brew install imagemagick",[],{"type":41,"text":49,"spans":50,"direction":22},"First, open your terminal and navigate to the folder that has your photo. To optimize it for the web, run this command:",[],{"type":45,"text":52,"spans":53,"direction":22},"magick input.jpg -sampling-factor 4:2:0 -strip -quality 85 -interlace Plane output.jpg",[],{"type":41,"text":55,"spans":56,"direction":22},"The \u003Ccode>-strip\u003C\u002Fcode> option removes the hidden camera data, and \u003Ccode>-quality 85\u003C\u002Fcode> compresses the file without a visible difference. The \u003Ccode>-sampling-factor 4:2:0\u003C\u002Fcode> option keeps the brightness sharp while reducing the color detail, and \u003Ccode>-interlace Plane\u003C\u002Fcode> saves a progressive JPG that loads smoothly. Just remember to replace \u003Ccode>input.jpg\u003C\u002Fcode> with your actual filename.",[],{"type":41,"text":58,"spans":59,"direction":22},"To compare the sizes, run \u003Ccode>ls -lh input.jpg output.jpg\u003C\u002Fcode>. In the video, a \u003Ccode>3.7M\u003C\u002Fcode> photo drops to \u003Ccode>1.2M\u003C\u002Fcode> and still looks the same. Open \u003Ccode>output.jpg\u003C\u002Fcode> to confirm.",[],{"type":61,"oembed":62},"embed",{"embed_url":63,"type":61},"",{"type":41,"text":65,"spans":66,"direction":22},"One more tip: for even smaller files, switch to WebP by running \u003Ccode>magick input.jpg -strip -quality 75 output.webp\u003C\u002Fcode>.",[],{"results":68,"page":37,"results_per_page":109,"results_size":109,"total_results_size":110,"total_pages":37},[69,88,90],{"id":70,"uid":71,"url":6,"type":7,"href":72,"tags":73,"first_publication_date":10,"last_publication_date":10,"slugs":74,"linked_documents":76,"lang":14,"alternate_languages":77,"data":78},"av7XERIAACcAmDy5","hyperfine-benchmark-python-script","https:\u002F\u002Fmarks-personal-website.cdn.prismic.io\u002Fapi\u002Fv2\u002Fdocuments\u002Fsearch?ref=awdlAxIAACcAJjXm&q=%5B%5B%3Ad+%3D+at%28document.id%2C+%22av7XERIAACcAmDy5%22%29+%5D%5D",[],[75],"hyperfine-how-to-benchmark-a-python-script",[],[],{"image":79,"title":85},{"dimensions":80,"alt":81,"copyright":6,"url":82,"id":83,"edit":84},{"width":31,"height":32},"Hyperfine: How to Benchmark a Python Script","https:\u002F\u002Fimages.prismic.io\u002Fmarks-personal-website\u002FwHSLchMR8qvd2IUQ_hyperfine-benchmark-python-script.png?auto=format,compress","wHSLchMR8qvd2IUQ",{"x":36,"y":36,"zoom":37,"background":38},[86],{"type":19,"text":81,"spans":87,"direction":22},[],{"id":4,"uid":5,"url":6,"type":7,"href":8,"tags":9,"first_publication_date":10,"last_publication_date":10,"slugs":11,"linked_documents":13,"lang":14,"alternate_languages":15,"data":89},{"image":29,"title":17},{"id":91,"uid":92,"url":6,"type":7,"href":93,"tags":94,"first_publication_date":10,"last_publication_date":10,"slugs":95,"linked_documents":97,"lang":14,"alternate_languages":98,"data":99},"av7XFBIAAC0AmDzM","hyperfine-export-results-csv","https:\u002F\u002Fmarks-personal-website.cdn.prismic.io\u002Fapi\u002Fv2\u002Fdocuments\u002Fsearch?ref=awdlAxIAACcAJjXm&q=%5B%5B%3Ad+%3D+at%28document.id%2C+%22av7XFBIAAC0AmDzM%22%29+%5D%5D",[],[96],"hyperfine-how-to-export-results-to-csv",[],[],{"image":100,"title":106},{"dimensions":101,"alt":102,"copyright":6,"url":103,"id":104,"edit":105},{"width":31,"height":32},"Hyperfine: How to Export Results to CSV","https:\u002F\u002Fimages.prismic.io\u002Fmarks-personal-website\u002FEnLW4_wsg-hN24G5_hyperfine-export-results-csv.png?auto=format,compress","EnLW4_wsg-hN24G5",{"x":36,"y":36,"zoom":37,"background":38},[107],{"type":19,"text":102,"spans":108,"direction":22},[],3,94,1795646747354]