19
20

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ImageMagickを使ったグレイスケール、反転、RGB入れ替えについて

Last updated at Posted at 2014-06-27

元画像

img.png

グレイスケール

convert img.png -type GrayScale img_gray.png

img_gray.png

反転

convert img.png -negate img_negate.png

img_negate.png

RGB入れ替え

RGBを入れ替えるにはいったんR,G,Bの画像に分解してから結合する。

Rのみ

convert img.png -fX R img_R.png

img_R.png

Gのみ

convert img.png -fX G img_G.png

img_G.png

Bのみ

convert img.png -fX B img_B.png

img_B.png

RGB → RBGに入れ替え

convert ( img_R.png img_B.png img_G.png ) -set colorspace RGB -combine -set colorspace sRGB img_RBG.png

img_RBG.png

RGB → GRBに入れ替え

convert ( img_G.png img_R.png img_B.png ) -set colorspace RGB -combine -set colorspace sRGB img_GRB.png

img_GRB.png

19
20
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
19
20

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?