You can find that with this simple formula: ((total longest side) - (total desired length)) / 2 To keep that crop in the center, then, I’ll need 105px offset. The greater than sign tells it to take the original file (i.e., “resize-gif.gif”) and save the cropped version as “resize-gif-cropped.gif” in the same directory.Īlmost right…but it’s offset to the top right-hand corner, so we’re not getting the middle of the gif cropped to a 1:1 square. gifsicle -crop 0,0+270x270 resize-gif.gif > resize-gif-cropped.gif Next, we provide the cropped dimension: 270x270 as our width and height respectively. For now, let’s just work on getting it to crop the image. 0,0 will start the crop from the top right-hand corner (i.e., x1 = 0 and y1 = 0). The first two tell it where to start the crop from. The crop option takes four parameters: x1, y1 + width x height. ![]() Numbers 1, 3, and 4 are self-explanatorry, so let’s focus on #2. The crop option (tell it the size, positioning, etc.According to the documentation, we need to provide four things. Open Terminal and cd to the directory where your image is found. I want my final gif to be a 1:1 square, so 270x270 is my target size. Here’s a gif of the legendary Jurgen Klopp. On a Mac, you can install gifsicle using Home-brew with the following command: brew install gifsicle 2. Here’s a simple step-by-step guide to using it. ![]() I recently needed to crop a gif to a square and found this command-line tool for working with gifs called gifsicle.
0 Comments
Leave a Reply. |