Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
JobLeonard opened this issue Apr 9, 2018 · 12 comments
Open

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

JobLeonard opened this issue Apr 9, 2018 · 12 comments

Comments

@JobLeonard
Copy link

JobLeonard commented Apr 9, 2018

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
Copy link
Member

kornelski commented Apr 9, 2018

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
Copy link
Author

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
Copy link
Member

kornelski commented Apr 9, 2018

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

@JobLeonard
Copy link
Author

Well that makes it easier :)

@JobLeonard
Copy link
Author

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
Copy link
Member

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

@majkinetor
Copy link

@JobLeonard

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

@DumbJoe
Copy link

DumbJoe commented Aug 27, 2020

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
Copy link
Author

(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
Copy link

Droyk commented Mar 1, 2021

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

@JobLeonard
Copy link
Author

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
Copy link

Droyk commented Mar 3, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants