gifski icon indicating copy to clipboard operation
gifski copied to clipboard

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

Open JobLeonard opened this issue 6 years ago • 12 comments

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?

JobLeonard avatar Apr 09 '18 14:04 JobLeonard

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.

kornelski avatar Apr 09 '18 14:04 kornelski

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?

JobLeonard avatar Apr 09 '18 15:04 JobLeonard

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

kornelski avatar Apr 09 '18 16:04 kornelski

Well that makes it easier :)

JobLeonard avatar Apr 09 '18 17:04 JobLeonard

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?

JobLeonard avatar Apr 09 '18 20:04 JobLeonard

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

kornelski avatar Apr 09 '18 22:04 kornelski

@JobLeonard

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

majkinetor avatar Jan 31 '19 16:01 majkinetor

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?

DumbJoe avatar Aug 27 '20 19:08 DumbJoe

(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))

JobLeonard avatar Aug 29 '20 11:08 JobLeonard

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

Droyk avatar Mar 01 '21 22:03 Droyk

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))

JobLeonard avatar Mar 02 '21 09:03 JobLeonard

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

Droyk avatar Mar 03 '21 03:03 Droyk