ImageOptim / gifski

GIF encoder based on libimagequant (pngquant). Squeezes maximum possible quality from the awful GIF format.
https://gif.ski
Other
4.76k stars 140 forks source link

Windows: drag-and-droppable batch files like for pngquant? #37

Open JobLeonard opened 6 years ago

JobLeonard commented 6 years ago

So recently I had the luck that I could help out a scientist friend who had gigantic, mostly-empty PNGs of his data with only a handful of colours, by using pngquant to vastly reduce the PNG size without any visible loss.

To my very happy surprise, it came with a drag-and-drop batch file for automatically reducing a large stack of images, and it's pretty simple:

@echo off

set path=%~d0%~p0

:start

"%path%pngquant.exe" --force --verbose --quality=45-85 %1
"%path%pngquant.exe" --force --verbose --ordered --speed=1 --quality=50-90 %1

shift
if NOT x%1==x goto start

I was wondering: could we add the same for the Windows build of gifski? Or maybe even a version that includes ffmpeg to make converting a bunch of videos as simple as dragging/dropping it on the batch file?

kornelski commented 6 years ago

In theory yes. In practice, I'm not a Windows programmer, and whenever I try to do something on Windows it makes my cry, so there's zero chance it will come from me.

ffmpeg is pretty hard to compile on any platform. I have no idea how to build that on Windows, and to make it redistributable.

There's a GUI for macOS.

For Windows, your best bet is to install ffmpeg separately and then script it yourself to make temporary PNG frames.

JobLeonard commented 6 years ago

Not a Windows dev either but stuck with it for now.

If you give me some sensible parameters to pass to gifski I could try working out the bat file!

I can also try to make an ffmpeg-one, put it in a sub-folder together with an html file titled [IMPORTANT] Store ffmpeg.exe in this folder.html which contains this:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>ffmpeg required</title>
  </head>
  <body style='text-align: center;font-weight: bold;'>
    <p>The drag and drop batch files only work if there is an ffmpeg.exe binary in the same folder. You can download one from:</p>
    <p><a href='https://ffmpeg.org/'>https://ffmpeg.org/</a></p>
  </body>
</html>

Would be about as basic yet still helpful as the instrutions can get, no?

kornelski commented 6 years ago

There's nothing to configure in gifski. You need to specify -o output-path and PNG frames. https://gif.ski

JobLeonard commented 6 years ago

Well that makes it easier :)

JobLeonard commented 6 years ago

BTW, since generating the downloadable releases doesn't seem to be part of the repo, should I just copy the .bat file here once I figured it out?

kornelski commented 6 years ago

Yes, please drop files in win/ folder, and I'll copy them to the package.

majkinetor commented 5 years ago

@JobLeonard

FYI, basically anybody can create that kind of frontend easily in a less then hour with external tool/dsl such as AutoHotkey

DumbJoe commented 4 years ago

FYI, basically anybody can create that kind of frontend easily in a less then hour with external tool/dsl such as AutoHotkey

Why dont u do it then if its so easy and quick?

JobLeonard commented 4 years ago

(for the record, I switched back to Linux so I haven't been able to finish this small task (and obviously also completely forgot about it, my bad))

Droyk commented 3 years ago

Hey @JobLeonard, I know you might be busy but can you please tell us your progress so far?

JobLeonard commented 3 years ago

Well...

(for the record, I switched back to Linux so I haven't been able to finish this small task (and obviously also completely forgot about it, my bad))

Droyk commented 3 years ago

still the same ehh.. well hope you find the time someday to finish it.