Terminal

Homebrew

FFMPEG

Making gifs

1
ffmpeg \
2
-i yourFile.mov \
3
-r 15 \
4
-vf scale=512:-1 \
5
-ss 00:00:03 -to 00:00:06 \
6
yourFile.gif
7
8
#hq
9
ffmpeg -i demo.mov -vf "fps=15,scale=800:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 output.gif
10
​
Copied!

ImageMagick

Documentation

Compression

1
#basic
2
magick image.jpg -strip -interlace Plane -gaussian-blur 0.05 -quality 85% -resize 75% result.jpg
3
​
4
# compress all jpg in folder
5
magick *.jpg -strip -interlace Plane -gaussian-blur 0.05 -quality 85% result.jpg
6
7
#parent folder
8
convert *.jpg -strip -interlace Plane -gaussian-blur 0.05 -quality 85% -set filename:f '%t_web' ../'%[filename:f].jpg'
9
​
10
# into target folder in same directory
11
mogrify *.jpg -strip -interlace Plane -gaussian-blur 0.05 -quality 85% -path ../web *.jpg
12
​
13
# into target folder in parent directory
14
mogrify *.jpg -strip -interlace Plane -gaussian-blur 0.05 -quality 85% -path web *.jpg
Copied!

Change file format

    Your EPS file is in CMYK colorspace. You need to convert it to sRGB before processing it

PNG to JPG

white bg
black bg
1
//batch
2
mogrify -background white -flatten -format jpg *.png
3
​
4
// single
5
convert Chun.png -background red -flatten png_small.jpg
6
​
7
// and compress
8
convert moom_ref.png -format jpg -quality 85% test.jpg
9
convert moom_ref.png -format jpg -strip -interlace Plane -gaussian-blur 0.05 -quality 85% test.jpg
10
​
11
​
12
​
Copied!
1
//single
2
convert *.png -alpha off image.jpg
3
​
4
// batch
5
magick mogrify -format jpg *.png
Copied!

EPS to PNG

1
mogrify -format png -density 100 -colorspace sRGB -background transparent -units PixelsPerInch -resize 2475x3525 *.eps
Copied!

Extract alpha from PNG

1
mogrify -set colorspace RGB -alpha extract -format jpg *.png
Copied!

Extract alpha from white

1
convert test.jpg -fuzz 50% -transparent white result.png
2
​
3
//batch
4
mogrify -fuzz 50% -transparent white -set colorspace RGB -alpha extract -format jpg *.png
5
​
6
​
7
// batch add alpha from white in pngs, save to new folder
8
mogrify -fuzz 50% -transparent white -set colorspace RGB -alpha extract -format jpg -path ../mask *.png
Copied!

Extract color from image

1
// select red, fill rest with black
2
convert test.png -fill white -fuzz 10% -opaque red output.jpg
3
​
4
// has black outline
5
convert test.png -fill black -fuzz 20% -opaque red -transparent black output.png
6
convert test.png -fill black -fuzz 5% -opaque red -transparent black output.png
7
​
8
mogrify -fill black -fuzz 5% -opaque red -transparent black output.jpg *png
9
​
10
// select red only
11
​
12
convert test.png -fill black -fuzz 20% -opaque #B93C3C -transparent black output.png
13
​
14
​
Copied!

Converting images to black or a fill color

1
//batch overwrite
2
mogrify -format jpg -fill black -background black -colorize 100% *.jpg
3
​
Copied!

HtTrack

1
http://duitbetter.com/2021/04/05/shader-dev-study-01-c-arnold/,http://duitbetter.com/2021/04/12/shader-dev-study-02-sidemask-pattern/,http://duitbetter.com/2021/04/20/shader-dev-study-03-height-to-color-pattern/,http://duitbetter.com/2021/05/09/shader-dev-study-04-moom-osl-shader/
2
​
3
+*.gif +*.jpg +*.png +*.mp4
Copied!

Ultimate Mac environment setup

Homebrew

packages
graphical
1
#homebrew
2
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
3
​
4
#packages
5
brew install youtube-dl
6
brew install python
7
brew install imagemagick
8
brew install ghostscript
9
brew install npm
10
brew install storyboarder
11
​
12
$ sudo easy_install pip
13
$ sudo pip install --upgrade pip
14
​
15
#cask
16
brew install caskroom/cask/brew-cask
17
​
18
#update xcode
19
sudo rm -rf /Library/Developer/CommandLineTools
20
xcode-select --install
Copied!
1
#utility
2
brew cask install google-chrome
3
brew cask install obs
4
brew cask install streamlabs-obs
5
brew cask install clipgrab
6
brew cask install spotify
7
brew cask install handbrake
8
brew cask install vlc
9
brew cask install easyfind
10
brew cask install station
11
brew cask install sync
12
brew cask google-backup-and-sync
13
brew cask install the-unarchiver
14
brew cask install zoomus
15
brew cask install alfred
16
​
17
#code
18
brew cask install atom
19
brew cask install processing
20
​
21
# design
22
brew cask install figma
23
brew cask install blender
24
brew cask install adobe-creative-cloud
25
brew cask install zxpinstaller
Copied!

Atom setup

1
#Go to Menu > Install Shell Commands
2
#run below
3
apm install adobe-script-runner atom-beautify prettier-atom atom-spotify2
4
atom-transpose case-keep-replace change-case copy-path duplicate-line-or-selection
5
editorconfig file-icons git-plus highlight-selected local-history project-manager
6
related set-syntax sort-lines sublime-style-column-selection tab-foldername-index
7
toggle-quotes atom-wrap-in-tag atom-ternjs autoclose-html
8
autocomplete-modules color-picker docblockr emmet emmet-jsx-css-modules
9
es6-javascript js-hyperclick hyperclick pigmentstree-view-copy-relative-path
10
lodash-snippets language-babel atom-jest-snippets one-dark-ui dracula-theme
11
​
12
##react-es7-snippets sync-settings linter-eslint
13
​
Copied!

Get all DMG

1
#utility
2
open https://www.pureref.com/freedownload.php?build=OSX64.dmg&version=1.11.1&downloadKey=kwshPqIAWUNsGVwJYCjKag%3D%3D
3
#utorrent
4
#Microsoft Office
5
open https://login.microsoftonline.com/?whr=scad.edu
6
open https://depts.scad.edu/coronavirus/academic-software
7
​
8
# optimize
9
open https://apps.apple.com/us/app/magnet/id441258766?mt=12
10
11
#creative
12
open https://www.blackmagicdesign.com/products/davinciresolve/
Copied!

Change screenshot directory

1
cd ~/desktop
2
mkdir screenshots
3
​
4
defaults write com.apple.screencapture location ~/desktop/screenshots
5
defaults write com.apple.screencapture type -string "png"
Copied!
1
defaults write com.apple.screencapture disable-shadow -bool true
2
killall SystemUIServer
Copied!
​
Last modified 4mo ago