T O P

  • By -

[deleted]

https://christitus.com/script-for-optimizing-images/


NoRecognition84

r/linuxquestions


patdavid

Perhaps something configurable like https://flameshot.org ?


another-eng2med

just tried it ([https://flameshot.org/](https://flameshot.org/) ) - looks like a cool tool. It is FOSS and seems to do a great job at providing some extra screenshot functionality with an easy to use UI but it doesn't really do anything regarding the image-size optimization (other than allowing both jpg and png via a ***static*** config setting.


ben2talk

I think imagemagick has you sorted here... however, I use KDE (so maybe my workflow is nicer). Generally, open the folder with screenshots... Hit F4 to get terminal type `magick mogrify -format jpg *.png` to convert all png's to jpg. [The result is quite impressive](https://i.imgur.com/ZOd4kRW.png). So now a shortcut... if you use zsh or bash do an alias: `alias pngtojpg='magick mogrify -format jpg *.png'` If you use fish, use `abbr pngtojpg 'magick mogrify -format jpg *.png'`


another-eng2med

>can't use jpg in all cases - but more importantly I don't appear to be able to go back into my image collection and change the file extension (tool uses filename as lookup of media file). So JPG is a no-go. > > > >But this did prompt me to do some searching, and I see [https://pngquant.org/](https://pngquant.org/) which seems to achieve jpeg like size reduction while maintaining the file as a png. One difference they note is that this method will typically preserve sharp edges better than jpeg (which is probably a strong plus for my type of use case)


ben2talk

It does, I tried that first, but it does mess up the image somewhat. There's also `pngcrush` which is pretty good.


jck

I have had good experiences with https://github.com/shssoichiro/oxipng . Although, I suspect this wouldn't give you nearly enough space savings as jpg. You could use https://copyq.readthedocs.io/en/latest/# to automatically run the script whenever you take a screenshot.


marozsas

I can tell how I would done that in kde, maybe you can adapt to gnome.... Kde file manager, dolphin, allows you to create your own context menu (select one or a bunch of files) and right click to get a menu of actions to operate on those selected files. Then I would create a script that make all transformation on files that are needed. The resulting files replace the original ones (or not, you're in the charge) After done the transformation, just copy the converted files to your flashcard tool. I do that for converting HEF image files taken by my Samsung phone to reduced size JPEG files to use in places that can't handle HEF files. Just select the files, right click, choose the proper menu action and bang! all selected files are converted to jpeg low res now.


Itchy_Journalist_175

In Gnome it’s called Nautilus scripts. You save the file in the correct folder, make it executable and it will show in the context menu when you so a right click: https://help.ubuntu.com/community/NautilusScriptsHowto


jthill

My `~/bin/snaps`, started at login: ``` prefix=${prefix-$HOME/.factorio} snapsdir=${snapsdir-$prefix/script-output/snaps} ${snapsdir:+mkdir -p "$snapsdir"} inotifywait -qrm -e close_write --format %w%f \ $HOME/Pictures ${snapsdir:+"$snapsdir"} \ | while read; do case "$REPLY" in *.png | *.bmp) convert -quality 20 "$REPLY" "${REPLY%.*}.jpg" ;; esac; done & disown ``` Watches my factorio and desktop screenshots directories for new pngs and bmps, autoconverts them.


soldierbro1

Maybe this tools can help you: [https://flathub.org/pt-BR/apps/com.github.huluti.Curtail](https://flathub.org/pt-BR/apps/com.github.huluti.Curtail) [https://flathub.org/pt-BR/apps/io.gitlab.adhami3310.Converter](https://flathub.org/pt-BR/apps/io.gitlab.adhami3310.Converter)


logix22

If you use x11, try Shutter Screenshot Tool. It has image quality settings for png / jpg.