Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
20
Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

posted at

updated at

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

元画像

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

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
20
Help us understand the problem. What are the problem?