NickeManarin / ScreenToGif

🎬 ScreenToGif allows you to record a selected area of your screen, edit and save it as a gif or video.
http://www.screentogif.com
Microsoft Public License
23.42k stars 2.16k forks source link

feature_request(services): lossygif and ShortPixel support #445

Open Kristinita opened 5 years ago

Kristinita commented 5 years ago

1. Summary

It would be nice, if lossygif and ShortPixel will integrated to ScreenToGIF. See Examples of expected behavior section for details.

2. Argumentation

As I say in this issue, ScreenToGIF create big size images. I hope, the situation will change in the future, but at January, 2019, browsers doesn't work normally with big animated images. It would be nice, if would be possible simply optimize images.

3. Table

3.1. Disclaimer

Tested on January 30, 2019. In the future users can get another results for programs and services in table.

3.2. Environment

3.3. Data

3.4. Excluded services

I don't include to table services, that doesn't support my 23,4 Mb GIF. Examples:

4. Table

Compressor Options Size (Mb) Information Link to GIF
ezgif.com Lossy; compression level β€” 200 5,85 No API; lossygif use 1
ShortPixel Lossy 8,15 100 images in month on free plan; API 1
GIF Compressor 8,58 50 Mb image size limit 1
Kraken Lossy 8,59 Only 100 Mb in month for free account 1
iLoveIMG Hard 13,1 1
gifsicle 1.89 β€” 128 colors gifsicle -i Kira.gif -O3 --colors 128 -o Kira__gifsicle256.gif 17,6 Bad quality 1
GIF Optimizer Free 2.0 Default 20,8 1
GIFMicro 1.6 1 21,6 gifsicle used 1
gifsicle 1.89 β€” 256 colors gifsicle -i Kira.gif -O3 --colors 256 -o Kira__gifsicle256.gif 21,9 Recommended on Stack Overflow 1
File Optimizer 13.50.2431 (x64) 1, 2 No I wait 14 minutes β†’ 0% optimized

5. Winner

Big compression & normal quality.

6. lossygif problems

  1. I can't find any working lossygif Windows binaries in Internet.
  2. Pull request lossygif β†’ gifsicle doesn't merge.
  3. Issues for lossygif repository not possible.
  4. I can't compile lossygif manually. I install Visual Studio β€” choco install visualstudio2017community -y β†’ I add path to nmake.exe as value of my PATH environment variable β†’ no success:
D:\SashaDemoRepositories\giflossy\src>nmake -f Makefile.w32

Microsoft (R) Program Maintenance Utility Version 14.00.24210.0
Copyright (C) Microsoft Corporation.  All rights reserved.

        copy win32cfg.h ..\config.h
        1 file(s) copied.
        cl -I.. -I..\include -DHAVE_CONFIG_H -D_CONSOLE /W2 /O2 /c clp.c
Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24210 for x86
Copyright (C) Microsoft Corporation.  All rights reserved.

clp.c
..\config.h(134): fatal error C1083: Cannot open include file: 'stddef.h': No such file or directory
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.EXE"' : return code '0x2'
Stop.

D:\SashaDemoRepositories\giflossy\src>nmake -f Makefile.bcc

Microsoft (R) Program Maintenance Utility Version 14.00.24210.0
Copyright (C) Microsoft Corporation.  All rights reserved.

        bcc32 -I.. -I..\INCLUDE -DHAVE_CONFIG_H=1 -D_CONSOLE -O2 -D_setmode=setmode -c clp.c
'bcc32' is not recognized as an internal or external command,
operable program or batch file.
NMAKE : fatal error U1077: 'bcc32' : return code '0x1'
Stop.

I think, that set lossygif may be hard for another ScreenToGIF users too.

7. Examples of expected behavior

7.1. lossygif

To ScreenToGIF will add a setting lossygif. If value is true, user need to set lossygif_compression_level; possible integer values from 0 to 200. See setting description.

If both settings enabled, GIF will automatically compress by lossygif after creating.

7.2. ShortPixel

For ShortPixel I also have good result and this service have a normal limit for free users β€” 100 images in month. API documentation.

To ScreenToGIF will add a setting shortpixel. If value is true, user need to set shortpixel_api_key.

If both settings enabled, GIF will automatically compress by ShortPixel after creating.

Thanks.

Kristinita commented 4 years ago

Type: Partially worked πŸŒ“

1. lossygif

From April 2019 lossygif is a part of gifsicle. ScreenToGIF users can execute post encoding command:

gifsicle --lossy=200 --batch {p}

2. ShortPixel

ShortPixel have a Command Line Tool. Problems, why I don't close this issue:

  1. It works for all files in the folder. I couldn't find in the documentation, how it works for specific files.
  2. my output:

    D:\SashaForks\shortpixel-php\lib>php cmdShortpixelOptimize.php --api-key=<My real API key> --folder=D:\SashaDebugging\KiraShortPixel
    
    CLI5ec91535960c5@2020-05-23 12:21:09 (0.00s) (M: 1,188,128) > cURL is not enabled. ShortPixel needs Curl to send the images to optimization and retrieve the results. Please enable cURL and retry.

    It strange, because I have even 4 cURL instances:

    D:\SashaForks\shortpixel-php\lib>where curl
    C:\Windows\System32\curl.exe
    D:\Chocolatey\bin\curl.exe
    D:\Scoop\apps\miniconda3\current\Library\bin\curl.exe
    C:\Program Files\Git\mingw64\bin\curl.exe

Thanks.

NickeManarin commented 4 years ago

Indeed, it only takes a whole folder. You would need to save the file to a folder with nothing else inside, to use that service.

Anyway, I added a macro to the post encoding commands: {u} = URL of the file uploaded. Not sure if it helps.