Ben Chuanlong Du's Blog

It is never too late to learn.

Tips on Creating Docker Images

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

  1. Docker caches building operations. When cache for an operation is available, Docker use the cache layer directly and avoid building the layer again.

  2. The command ARG creates environment variables for build-time …

Tips on Pillow

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

PIL.Image.Image.crop

Notice that the bounding box is inclusive/EXCLUSIVE like the range function. PIL.Image.Image.crop does not accept a bounding box of zero size!

PIL.Image …

Copy Pictures from an Android Phone to a Computer

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement! Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

You have to have a SSH server installed on the Android phone …

Show Image in Terminal

** Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

viu is a simple terminal image viewer written in Rust. It works perfectly in kitty . In terminals which does not support inline image display protocols, viu will show the image in …

Tips on FFmpeg

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

It is suggested that you use OpenCV for Python and moviepy (instead of FFmpeg) to manipulate multimedia.

  1. extrac audio from video

  2. convert between different formats of audios

Record Screen

The command …

Get Coordinates of Points on a Screen or Image

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Get the Coordinate of a Pixle/Point on an Image

Most image editing software (e.g., GIMP) can tell you the coordinate of a point on an image.

Get the Coordinate …