Live data from Hacker News

Show HN: I built PixSpeed to optimize website images for free

pixspeed.com

21–29 of 29 posts

Re: Show HN: I built PixSpeed to optimize website images for free

#21

Earlier quoted context omitted.

"All images are deleted after 1 hour" - so they're using a server and it's a valid ask. My question is - why does this require a server? Write it in something that compiles to LLVM / WASM and just make a static page. Infinitely scalable and just pay for the domain (and CDN provider if applicable) both likely nominal cost.

It can pull images from a domain. That would be difficult (since for client-side rendered sites it would require loading the site in a sandboxed environment) or impossible (if the site actively prevents that using CORS or similar, or if it happens to include scripts which expect to be run in a normal environment).

Yup totally fair - would likely require you upload the images manually for pure client-side.

You might still be able to offset a portion of the compute by just figuring out the URLs of the images on the back-end, sending that list to the client, which would then download and do the optimization / resizing.

Re: Show HN: I built PixSpeed to optimize website images for free

#23

Earlier quoted context omitted.

"All images are deleted after 1 hour" - so they're using a server and it's a valid ask. My question is - why does this require a server? Write it in something that compiles to LLVM / WASM and just make a static page. Infinitely scalable and just pay for the domain (and CDN provider if applicable) both likely nominal cost.

Or why is it not a simple shell call to Imagemagick?

Then it needs a server

Re: Show HN: I built PixSpeed to optimize website images for free

#25

Earlier quoted context omitted.

Then it needs a server

Not if you port the shell and OS and ImageMagick to WASM first!

ImageMagick in Wasm lets you do lots of nifty stuff client-side. Here's a photocopy simulation thingie I made for instance: https://photocopy.fuglede.dk/

Re: Show HN: I built PixSpeed to optimize website images for free

#26

Earlier quoted context omitted.

Not if you port the shell and OS and ImageMagick to WASM first!

ImageMagick in Wasm lets you do lots of nifty stuff client-side. Here's a photocopy simulation thingie I made for instance: https://photocopy.fuglede.dk/

That is fun indeed :) Good effect!

Re: Show HN: I built PixSpeed to optimize website images for free

#27

The best feature of my purpose-built static site generator is that it automatically builds (mostly) optimized WEBPs from any source image [1]. Not only does it reduce the image size, but it outputs many sizes of the image so that I can use an image `srcset`. The browser then automatically downloads the optimally sized image for the element. It's a game changer to be able to copy photos directly from my Google Photos…

This is also pretty easy is Hugo, albeit maybe less automatic [0]. {{ $image.Resize "600x webp q50" }} [0] https://gohugo.io/content-management/image-processing/

I tried this a couple years ago with Netlify and Hugo targeting 1x, 2x and 3x sized images. The processing time is too slow with more than around 500 images, resulting in build timeouts.

I switched to checking in the alternate image sizes and using a hugo image render hook to check for the existence of the alternative images to generate the appropriate srcset.

Re: Show HN: I built PixSpeed to optimize website images for free

#28

Earlier quoted context omitted.

"All images are deleted after 1 hour" - so they're using a server and it's a valid ask. My question is - why does this require a server? Write it in something that compiles to LLVM / WASM and just make a static page. Infinitely scalable and just pay for the domain (and CDN provider if applicable) both likely nominal cost.

It can pull images from a domain. That would be difficult (since for client-side rendered sites it would require loading the site in a sandboxed environment) or impossible (if the site actively prevents that using CORS or similar, or if it happens to include scripts which expect to be run in a normal environment).

There is also the ability to run things like Playwright on the edge a la Cloudflare Workers. You can fallback to rendering JS required sites through that and do clientside imagemagick WASM shenanigans on the client once the worker returns direct links to all the images.
Post reply on HN