7/3/2023 0 Comments Imagemagick or gifsiclellms Running LLaMA 7B and 13B on a 64GB M2 MacBook Pro with llama.So there you have it, ImageMagick is a powerful tool for basic image processing tasks, but it has many more tools and options to explore. Gifsicle can convert image sequences into GIFs by itself, but I found out that both tools perform better together. mediawiki How to run MediaWiki with SQLite on a macOS laptop - The available commands can be found on the Gifsicle Man Page.twitter Exporting and editing a Twitter Spaces recording. macos Shrinking PNG files with pngquant and oxipng.The distance can be in absolute intensity units or, by appending % as a percentage of the maximum possible intensity (255, 65535, or 4294967295). The -fuzz 7% option is documented here - it treats similar colours as the same colour: I ran this against this 1.3MB animated GIF: This saves over the original, so make a copy of it first. Which gave me a 723KB file which I think looks good enough for my purposes:įound this tip on Stack Overflow: to reduce the site of an animated GIF, you can use the mogrify tool like this: mogrify -layers 'optimize' -fuzz 7% sqlite-convert-demo.gif The best Animated GIF Creator alternative to Gifsicle is ImageMagick, which is both free and Open Source. So I tried this instead: gifsicle -O3 -colors 128 -lossy -o datasette-launch-smaller-2.gif datasette-launch.gif The reduced colours there were a bit too much for me, especially for the purple gradient buttons at the end. rw-r-r- 1 simon wheel 613K Sep 13 12:54 1 simon wheel 3.7M Sep 13 12:52 datasette-launch.gif tmp % gifsicle -O3 -colors 48 -lossy -o datasette-launch-smaller.gif datasette-launch.gif I installed it using brew install gifsicle and ran it like this: /tmp % ls -lah 1 simon wheel 3.7M Sep 13 12:52 datasette-launch.gif You can tweak the number of colours and loss to get it smaller but that’s when it starts to look worse to my eyes Saw your GIF size TIL, and gifsicle -O3 -colors 48 -lossy gets it down to 320k. Simon Willison’s TILs Compressing an animated GIF with gifsicle or ImageMagick mogrify Using gifsicle Once the gif has been created you can use gifsicle to create a smaller version, with gifsicle -O3 -k 8 -lossy=80 -o tty-small.gif tty.Compressing an animated GIF with gifsicle or ImageMagick mogrify | Simon Willison’s TILs Ttygif will leave directories in /tmp that you may need to clean up Note, I also got errors when I tried to build gifs from processes that produced a lot of output, which turned out to be imagemagick related (see issue), so I updated my /etc/ImageMagick-6/policy.xml to have the following set This is fixed by setting an enviroment variable export WINDOWID=$(xdotool getwindowfocus)īut I have created the following alias in my ~/.bashrc to save remembering that alias ttygif='WINDOWID=$(xdotool getwindowfocus) ttygif' When I initially tried to do this I got the following error Error: WINDOWID environment variable was empty. It can output to the screen, postscript, printers, or pipe the image. ImageMagick Examples Preface and Index Video to GIF, Optimization Summary De-interlace a Video Frame. ImageMagick is primarily an image converter and able to use lots of different formats. Just dont make it a definite requirement for a script to work. Upon completion the recording is converted to a gif, using ttygif ttygif myRecord Also 'gifsicle', 'intergif', or other for LZW compression optimizers for GIF animations, have good and bad points. Tmux sessions come with some caveats, the pane that had the ttyrec called in it is the only one that will record any commands issued, whilst the whole terminal is included in the image. I’ve thus far been able to record vim sessions, and tmux sessions. Then whatever is intended to be recorded is actioned in that terminal, followed by to end the ttyrec session. Usage is quite simple, first call ttyrec with the name of the file that will be created/used to store the commands in. I was fortunate enough to be able to install them all using apt apt install ttyrec ttygif imagemagick gifsicle xdotool I was looking for imagemagick solution as I am familiar with it, but in the end I went with sams suggestion of gifsicle. Linux users will need to install the following The great news is, you can, and it’s not actually very difficult (nothing is once you know how to do it!) There is a website ( asciicinema) that will do most of the work for you, but, you lose some of the control, and, dammit, engineers should be able to do things on their own, right? If you’re wanting to share examples of working in a terminal, such as what I will be pasting below, then you will be needing a way to record, and share what happens.
0 Comments
Leave a Reply. |