Thursday, 7 August 2025

Converting images to pdf in Linux

Occasionally, I have to scan official papers (dead-tree-copy) and I'd like to keep the result small, and in one pdf.

So, a one liner command would be nice.

magick mrbear*.png -quality 10% -set filename:base "%[basename]" "%[filename:base].jpg"

The commandline above automatically creates an appropriate .jpg file for each mrbear*.png file. So mrbear_0001.png will cause a mrbear_0001.jpg.

Just what I wanted. Went from 8 megabytes picture to a 200 kb picture.

And then converting the new images over to a pdf file is ridiculously simple:

magick mrbear*.jpg mrbear.pdf

Magick!

References

DigitalOcean - Reduce File Size of Images in Linux - CLI and GUI methods
https://www.digitalocean.com/community/tutorials/reduce-file-size-of-images-linux
GitHub - Convert images but keep the original file name #6494
https://github.com/ImageMagick/ImageMagick/discussions/6494
ImageMagick
https://imagemagick.org/

Thursday, 31 July 2025

LocalSend

I've always had problems getting files transferred from tablets, mobile phones, photocamera, MacBooks, Linux, Windows.

It often boils down to having to install an app of somekind, or mounting a virtual filesystem (if we're talking about Linux) or installing a driver. And as I do not do it often, I always forget which tool I used and what steps I had to take.

Well, not anymore!

Thank the heavens for LocalSend1. It does everything I need, in a very easy way and it's Open Source too!

It's just a small network app that uses a REST Service and HTTPS to transfer files to other instances of itself on the Local Network. No internet required.

Addendum

The only thing to keep in mind, is that some devices (notably my MacBook) will ask for permission from you before allowing LocalSend (or any other Network App) to actually access the Local Network.

References

[1] LocalSend: Share files to nearby devices
https://localsend.org/#/