Archive for October, 2018

Adding a delay to the end of an animated gif

I converted a screen recording to a looping animated gif. It looked and played fine, but I also wanted it to pause for a few seconds at the end before starting the loop again. I couldn’t find an easy way to do this using online tools without increasing the file size of the result.

I eventually figured out how to add the delay using the open-source command-line tool gifsicle. Here is the command:

gifsicle -U original.gif "#0--2" -d200 "#-1" -O2 > with-delay.gif
  • The -U option unoptimizes the input gif so that we can operate on individual frames.
  • -d specifies the delay to use in hundredths of a second.
  • “#0” format specifies a frame number or range of frames. Negative numbers count backwards from the last frame, starting with #-1. So the range from the first to second-to-last frame is #0 to #-2 or “#0–2”.
  • -O2 (capital letter O) directs gifsicle to re-optimize the gif using recommended settings.

In summary, this command unoptimizes (-U) the original gif into its component frames; then says we want a new gif with the first frame through the second-to-last frame (#0–2) unchanged and the last frame (#-1) with a new delay of 2 seconds (200 hundredths of a second); and finally specifies that we want to re-optimize the result (-O2).

Thanks to the gifsicle manual and a reddit user for helpful hints.

Leave a Comment

Microwave cooking frozen fish

I don’t think it’s widely known that (1) you don’t need to defrost fish before cooking, and (2) microwave cooking is not only fast and easy but yields better-tasting, melt-in-your-mouth results (at least for hapless chefs like me).

Most “fresh” fish sold in grocery stores is actually defrosted frozen fish. So it seems to me that you may as well just buy it frozen and let it sit in your freezer until you’re ready to cook. At that point, defrosting is time-consuming and smelly, so you may as well just cook it from frozen.

After doing some internet research and experimenting with frozen salmon and cod fillets, I feel it is my civic duty to share with the world the easiest, least messy, and most delicious way to cook fish.

  1. Rinse the frozen fillet in warm water to remove its crust of ice, then pat dry with a paper towel.
    (Do not skip this step! I learned this the hard way. The fish interior will not cook if there is too much ice/water on the outside. Also: you need to pat-dry the fish quickly or else the paper towel will stick.)
  2. Place the fillet on a plate. Drizzle with oil, salt, pepper, and any spices you want.
    (I often just spread coconut oil with a little salt and pepper and maybe some dried sumac. The internet is full of ideas… pesto, sriracha, mayonnaise, lemon, parsley… just be aware that too much water content will affect the cooking.)
  3. Cover the plate lightly.
    (It does not need to be airtight. I just use a normal plastic microwave cover.)
  4. Microwave on full power for 4 minutes.
    (This works well for an 8oz fillet in a 1000-watt microwave. A large fillet needs an extra minute or two of cook time.)
  5. Wait 1-2 minutes after the microwave stops. Then check the interior with a fork for uncooked areas (they appear translucent or bright). If there are uncooked areas, microwave again for 1 minute and wait 1 minute.
    (The reason for waiting is that the heat inside the fish continues to cook for a while even after the microwave stops.)

Over time you get a feel for how long you need to cook different fillet sizes in your microwave. The goal of course is for it to come out fully cooked (but not overcooked) after the first microwave session. In my 1000-watt microwave, 4-5 minutes is usually enough (plus the 1-2 minutes of waiting).

Leave a Comment