ã¿ããªå¤§å¥½ãImageMagickã¯ãå ¥åç»åã®ããã©ã«ãã®è²ç©ºéã¯sRGBã ã¨ã¿ãªãä¸æ¹ãå種ã®ç»åå å·¥ã®ãªãã¬ã¼ã¿ã¯å¯¾è±¡ã¨ãªããã¼ã¿ã®è²ç©ºéãRGBã§ãããã¨ãåæã¨ãã¦ããããããã£ã¦ãè²ç©ºéãæ示çã«å¤æããªãã§å¦çãè¡ãã¨çµæãããããªãã¨ã«ãªãã®ã ã本家の記事ã«ãæ¸ãã¦ãããããã¨ããªãµã¤ãºã§ãã£ã¦ãè²ç©ºéã®å½±é¿ãåãã¦ãã¾ãã
ãªãµã¤ãºããconvert old.jpg -resize 400x300 new.jpgãã¨ãããããã«æ¸ãã¦ãããµã¤ããå¤ãããããééãã§ã¯ãªãããæé©ã§ã¯ãªããããããã¯ãconvert old.jpg -colorspace rgb -resize 400x300 new.jpgãã£ã¦ãã£ã¦ã»ããã
人éã®è¦è¦ã®ç¹æ§ã¨ãã¦ãæãã¨ããã®è¼åº¦ã®å·®ã«ã¯ææã ããæããã¨ããã®è¼åº¦ã®å·®ã«ã¯éæã ã¨ããã®ããããæãé¨å±ã§è±é»çãç¹ããã¨æãããåããããæããå±å¤ã§è±é»çãç¹ãã¦ãå ã£ã¦ãããã ãããªããã ãããããªãã人éã®æè¦ç¹æ§ã対æ°çã§ããã¨ããçµé¨åã¯ヴェーバー・フェヒナーの法則ã¨ãã¦ç¥ãããã
ããããã£ã¦ãå¤ãã®ç»åãã©ã¼ãããã§ã¯ãç·å½¢RGBã®å¤ãsRGBã¾ãã¯ãã®å¤ç¨®ã®éç·å½¢ã¹ã±ã¼ã«ã«å¤æãã¦è¨é²ãã¦ãããsRGBã§ã¯ãä½è¼åº¦ï¼<=0.0031308ï¼ã®å¤ã¯å®æ°ï¼12.92ï¼åãã¦ç·å½¢ã«å¤æããä¸è¼åº¦ä»¥éã®å¤ã¯ã¬ã³ã2.4ãã¦ãã1.055ãæãã¦0.055ãå¼ããéç·å½¢å¤ã«å¤æãã¦ããã0.0031308ã¯ã©ã¡ãã®å¼ã§ã0.04045ã«ãªãã®ã§é£ç¶çã ãJPEGãªã©ã®å§ç¸®ãã©ã¼ãããã§ã¯ããã«ãã®sRGBå¤ãYCbCrãªã©ã®è²ç©ºéã«å¤æãã¦ä¿åããããã ãããã®ç»åã復å ããéã«ã¯éå¤æãé 次è¡ã£ã¦RGBå¤ãå¾ããã¨ã«ãªããRGBã¨sRGBã®éã®å¤æã¨éå¤æãPythonã§æ¸ãã¨ãããªæãã
def rgb_to_srgb(value, quantum_max=1.0): if value <= 0.0031308: return value * 12.92 value = float(value) / quantum_max value = (value ** (1.0 / 2.4)) * 1.055 - 0.055 return value * quantum_max def srgb_to_rgb(value, quantum_max=1.0): value = float(value) / quantum_max if value <= 0.04045: return value / 12.92 value = ((value + 0.055) / 1.055) ** 2.4 return value * quantum_max
ä¾ãã°ã16ãããã®å ç»åããã£ãã¨ãã¦ãä»®ã«RGB空éã®ã¾ã¾8ãããã§ä¿åããã¨ãªãã¨ã0ãã255ã¾ã§ã®å¤ã¯å ¨ã¦0ã«ãªãã256ãã511ã¾ã§ã®å¤ã¯å ¨ã¦1ã«ãªã£ã¦ãã¾ããªã©ã人éãææãªã¯ãã®æé¨ã®æ å ±æ¬ æãæ¿ãããããããsRGBã«å¤æããã¨ç¶æ³ãæ¹åããã0ãã205ï¼= 65535 * 0.0031308)ã¾ã§ã®å¤ã¯12.92ãæãã¦0ãã2648.6ã«å¤æãã¦ãã8ãããã«è½ã¨ããã¦0ãã10ã¾ã§ã¨ãªãã206ãã255ã¾ã§ã¯ã¬ã³ãå¤æã§2661.3ãã3243.9ã«å¤æãã¦ãã8ãããã«è½ã¨ããã¦10ãã12ã¾ã§ã¨ãªãã®ã§ãåããã¦13é調ãæ®ãã256ãã511ã¾ã§ã¯ã¬ã³ãå¤æã¨8ãããåã«ãã12ãã21ã¾ã§ã«ãªãã9é調ãæ®ãã512ãã767ã¾ã§ã¯21ãã28ã¾ã§ã®7é調ãæ®ããããææé¨ãã¬ã³ãå¤æãã¦ãã¾ãã¨é調ãå¤ãå²ãå½ã¦ãããå«ãããããããã¾ãã«æãé åã¯äººéã«ãè¦èªã§ããªãããã¤ãºã«åããã¦æç¨ãªæ å ±ãæç¥ããã¦ããªãã ãããããç·å½¢å¤æãæ··ãã¦0ãã255ã«13é調ãå²ãå½ã¦ãã¨ããä½æ¦ã¯å¦¥å½ã ããããã®ãããã®è©±ã¯以前の記事ã«ãæ¸ãããä¸æ¹ã§ãæé¨ã®é調ãè±å¯ã«ããåãæé¨ã®é調ã¯å°ãç ç²ã«ãªãã64952ãã65535ã¾ã§ã¯8ãããã ã¨å ¨ã¦255ã¨ãªã£ã¦ãã¾ãããããã64952ã¨65535ã®0.88%ã®å·®ãå¼å¥ã§ãã人éã¯å¤ããªãã ããã
ã¡ãªã¿ã«ãImageMagickããã®ä»ã®ç»åå å·¥ã½ããã¦ã§ã¢ã«å ¸åçãª16ãããã®ä½æ¥ç©ºéã«ããã¦ä¸è¿°ã®ã¬ã³ãå¤æããããã¨ãææé¨65279ãã65535ã¾ã§ã®256é調ã¯ã65422ãã65534ã¾ã§ã®113é調ã«å§ç¸®ããããã¤ã¾ããææé¨256é調ã«éå®ãã¦è¨ãã°ä½æ¥ç©ºéä¸ã§RGBã¨sRGBã®å¤æãããã ãã§1.17ããããããã®æ å ±æ¬ æãèµ·ãã¦ãããã¨ã«ãªããããããæçµåºåãJPEGãªã8ãããã ãããã®ã¾ã¾ãã£ã¹ãã¬ã¤ã«è¡¨ç¤ºããã«ãã¦ããã¤ã¨ã³ã製åã§10ãããã¾ã§ãªã®ã§ãå°ãªãã¨ãä½æ¥ç©ºéä¸ã§ã®æ å ±æ¬ æã¯ãã¾ãæ°ã«ããªãã¦è¯ãããã ã
ãã¦ãç»åãã¡ã¤ã«ã®ã¡ã¿ãã¼ã¿ã«ãã®RGBå¤ã®è²ç©ºéãæ示ãã¦ããã¨ã¯éããªãã®ã§ãImageMagickã¯sRGB空éã ã¨ã¿ãªãã¦èªã¿è¾¼ããä¸æ¹ã§ãèªã¿è¾¼ãã çµæã®RGBåãã£ãã«ã®å¤ã¯ä½ã®å¤æãããªãã¾ã¾ä½æ¥ç©ºéã«ä¿æããããããã-level ãªãã¬ã¼ã¿ã -resize ãªãã¬ã¼ã¿ãªã©ã®ã»ã¨ãã©ã®ç»åå¦çã§ã¯ãRGBå¤ãç·å½¢ç©ºéã«ãããã¨ãåæã¨ããã¢ã«ã´ãªãºã ãå®è£ ãã¦ããããããã£ã¦ãç»åãã¼ã¿ãèªã¿è¾¼ãã ããå種ç»åå¦çã®ãªãã¬ã¼ã¿ãå®è¡ããåã«ãè²ç©ºéãRGBã«å¤æãã¦ããå¿ è¦ããããããã«ã¯ -colorspace ãªãã¬ã¼ã¿ã使ããè²ç©ºéã®ååã¯å¤§æåã¨å°æåãåºå¥ããªãã®ã§ãrgbã§ãRGBã§ãOKã
convert input.jpg -colorspace rgb {other operators} output.jpg
ããã¦ãããä¸ã¤éè¦ãªã®ããTIFFå½¢å¼ã§ãã¼ã¿ãæ¸ãåºãå ´åãåºåã®åã«æ示çã«sRGB空éã«åºã¥ããã¼ã¿ã«å¤æãããã¨ã ãJPEGã¯sRGBãåæã®å½¢å¼ãªã®ã§ãå ¥åãåºåãJPEGã§ããå ´åã¯sRGBã«æé»çã«å¤æãããã®ã ããTIFFã¯ããã§ã¯ãªãããªã®ã§ãTIFFåºåã§è²ç©ºéãsRGBã«ç´ããªãã¨ããããæãç»åãçæããã¦ãã¾ããããã¯ãªããªãæ°ã¥ããªãç½ ã ã
convert input.tif -colorspace rgb {other operators} -colorspace srgb output.tif
ãªããTIFFãªã©ã®å ¥åç»åã®è²ç©ºéãèªæã§ãªãå½¢å¼ã§ããããå®éã®ãã¼ã¿ãRGBã§ãªãå ´åã«ã¯ãã-set colorspaceãã§è²ç©ºéãæ示ãã¦ãããRGBã¸ã®å¤æãè¡ãå¿ è¦ããããä¾ãã°YUVãä¿æããTIFFç»åãå å·¥ããå ´åã以ä¸ã®ããã«ãªãã
convert input.tif -set colorsspace yuv -colorspace rgb {other operators} -colorspace yuv output.tif
RGBãè¨é²ããTIFFããã®ã¾ã¾å¦çãããªãã°ãè²ç©ºéã®å¦çã¯å¿ è¦ãªããéã«è¨ãã°ãè²ç©ºéã®æå®ãããªãã¦ããã®ã¯ãã®ã±ã¼ã¹ã ãã ã
convert input.tif {other operators} output.tif
ãã®è©±ã¯ãæ £ãã人ã«ã¯å½ããåã®ãã¨ãªãã ãããã©ãå¤ãã®ã¦ã¼ã¶ã¯è¦è½ã¨ãã¦ãã¾ãã ãããæ¬æ¥ã¯å ¨ã¦ã®ç»åå¦çãªãã¬ã¼ã¿ã«ã¤ãã¦ä½¿ãæ¹ãç¥ãåã«ãè²ç©ºéã®æ±ãã«ã¤ãã¦çéããã°ãªããªãã®ã ãããã¥ã¢ã«ã®æåã®æåã«èµ¤æåã§æ¸ãã¦ãã£ã¦ããããããªãã»ã©éè¦ã
ãªãµã¤ãºãããã ã£ããè²ãå¤ãããããããªãããè²ç©ºéã¯é¢ä¿ãªãã¨æããããããªãããããã§ã¯ãªããåé ã«æ¸ããæ¬å®¶ã®è¨äºã«ãããããã«ã-resize ãªãã¬ã¼ã¿ã¯å ¥åç»åã®å¹¾ã¤ãã®ç»ç´ ãæ··åãã¦åºåç»åã®æ°ããç»ç´ ãä½ãåºãã³ã³ããªã¥ã¼ã·ã§ã³æ¼ç®ãä¼´ãã®ã§ããã®ç»ç´ æ··åã®éã®å ç®å¦çã§è²ç©ºéã®å½±é¿ãåããã®ã ãä¾ãã° [A, B, C, D] ã¨ããä¸æ¬¡å ã®ãã¼ã¿ããªãµã¤ãºã㦠[O, P] ãä½ãã¨ãã¦ãOã¯Aã¨Bã®å¹³åå¤ããP'ã¯Cã¨Dã®å¹³åå¤ãåãã¨ãããã£ã«ã¿ï¼pixel averagingï¼ãæ³å®ãããAã0.25ãBã0.75ã ã¨ããã¨ãOã¯0.5ã«ãªãããããRGB空éãªããã®ã¾ã¾ç解ããã°è¯ãããsRGB空éã ã¨ããã¨ããããªãã¨ã«ãªããsRGBã®Aã®å¤ã0.25ãªãããã®çã®è¼åº¦ã¯0.0508ã ãBã®å¤ã0.75ãªãããã®çã®è¼åº¦ã¯0.5225ã ãçã®è¼åº¦ã®å¹³åã¯0.2866ã§ããã®sRGBå¤ã¯0.5717ã«ãªãã¹ãã ããããå®éã«ã¯0.5ã¨ããç»ç´ ãçæããã¦ãã¾ãã®ã§ãçµæã¨ãã¦ããæãç»åãçæããããã¨ã«ãªããå ç»åã§è¼åº¦å·®ã大ããç»ç´ ãé£ãåã£ã¦ããã¨ãæãæ¹ã«å¼ã£å¼µããã¦ãã¾ãã¨ãããã¨ã ãããã§ãå¤ãã®å ´åã§å ¨ä½ã®å°è±¡ã¯å¤ãããªãããä¾ãã°æ空ã®åçãsRGB空éã®ã¾ã¾ãªãµã¤ãºããã¨å°ããªæãæ¶ããç¾è±¡ã«æ²ãããã¨ã«ãªããå®éã® -resize ãªãã¬ã¼ã¿ã¯ããã¡ããè³¢ãLanczosãªããã£ã«ã¿ã使ã£ã¦ãããããã®ã ããsRGB空éã§ã¯æãæ¹ã«å¼ã£å¼µãããã¨ããå¾åã¯åãã ã
è¼åº¦ã調æ´ããã¬ã³ãè£æ£ã§ããã¡ããå½±é¿ããããè¼åº¦0.1ã®ç»ç´ ã«ã¬ã³ãè£æ£2.0ãæãããã¨ãèãããsRGBã«ããã0.1ã®çã®è¼åº¦ã¯0.01ã ããã®ã¬ã³ã2.0ã¯0.1ãªã®ã§ãsRGBã«ç´ãã0.3493ãçæãããã¹ãã ããããå®éã«ã¯0.3162ã®ç»ç´ ãçæãããã®ã§ãæå³ãããããæãç»åãçæããããã¨ã«ãªãããã®ä»ãå ç»åã®è¼åº¦å¤ãå©ç¨ããå ¨ã¦ã®ãªãã¬ã¼ã¿ã¯ãè²ç©ºéã®å½±é¿ãåãã¦ãã¾ãã
ImageMagickã§ç»åãçæããéã«ãè²ç©ºéã®æå®ã¯éè¦ã ãã¾ããè²ç©ºéã®ãã¨ãä½ãèããªãã§ç»åãçæãã¦ã¿ãã-size ã§ãã£ã³ãã¹ãµã¤ãºãæå®ãã¦ããã®å¾ã«è²ãæå®ãã¦ç»é¢ãå¡ãã®ã ããä»åã¯ã°ã©ãã¼ã·ã§ã³ãä½ã£ã¦ãã¦ãããããããã¹ããå¹¾ã¤ãéãã¦æç»ãããåºåã¯TIFFã§æ¸ãåºãã¦ããã
convert -size 400x300 "gradient:#222222-#dddddd" \ -pointsize 80 -font Times-Roman \ -gravity northwest -fill "#880000" -annotate +20+20 "TEST" \ -gravity center -fill "#008800" -annotate 0 'TEST' \ -gravity southeast -fill "#000088" -annotate +20+20 'TEST' \ test-default.tif
TIFFã ã¨ãã©ã¦ã¶ã§é²è¦§ã§ããªããã¨ãããã®ã§ãåºåãJPEGã«åå¤æããä¾ãè¼ããããã£ã³ãã¹ã«è²ãå¡ã£ã¦çæããæç¹ã§ã¯è²ç©ºéã¯sRGBã«ãªã£ã¦ãã¦ããã®è²æå®ã¯sRGB空éã«é©å¿ããã¦é©åãªè¼åº¦ã§æç»ããããæåãæ¸ã-annotate ãªãã¬ã¼ã¿ã¯sRGB空éã«RGB空éã®å¤ãçæããã®ã§ãã¬ã³ã1/2.4ã ãæããªããããã¦æ¸ãåºãæã«ã¯sRGBè²ç©ºéã®ã¾ã¾åºåãããããããã£ã¦ãèæ¯ã¯é©åã§ãæåã ãæããªãã
次ã«ããã£ã³ãã¹ãçæããç´å¾ã«ä½æ¥ç¨è²ç©ºéãRGBè²ç©ºéã«å¤æãããããããæ¸ãåºãåã«sRGBã«å¤æã¯ããªãã§ããã
convert -size 400x300 "gradient:#222222-#dddddd" \ -colorspace rgb \ -pointsize 80 -font Times-Roman \ -gravity northwest -fill "#880000" -annotate +20+20 "TEST" \ -gravity center -fill "#008800" -annotate 0 'TEST' \ -gravity southeast -fill "#000088" -annotate +20+20 'TEST' \ test-rgb-proc.tif
ããã¨ãæåãé©åã«æç»ãããããã«ãªãããæ¸ãåºãæã«å
¨ã¦ãã¬ã³ã1/2.4ã ãæããªãããã ãããã®åºåç»åãsRGBã§ãªãRGBã®ãã¼ã¿ã ã¨åãã£ã¦ä½¿ãå ´åã«ã¯ãããã§é©åã§ããã
æå¾ã«ãRGBã§æç»å¦çãè¡ã£ãä¸ã§ãsRGBã«å¤æãã¦ãä¿åããã
convert -size 400x300 "gradient:#222222-#dddddd" \ -colorspace rgb \ -pointsize 80 -font Times-Roman \ -gravity northwest -fill "#880000" -annotate +20+20 "TEST" \ -gravity center -fill "#008800" -annotate 0 'TEST' \ -gravity southeast -fill "#000088" -annotate +20+20 'TEST' \ -colorspace srgb \ test-rgb-proc-srgb-output.tif
èæ¯ãæåãé©åãªè¼åº¦ã§æç»ãããããã¦é©åãªè²ç©ºéã§ä¿åãããããããã¦åãã¦sRGBã¨ãã¦ææã®çµµãå¾ããããç¹°ãè¿ãã«ãªãããå
¥åã¨åºåã®ä¸¡æ¹ãJPEGã®å ´åã«ã¯åºååã®è²ç©ºéã®å¤æã¯çç¥ã§ããããã ãçç¥ããªãæ¹ãç²¾ç¥è¡çä¸ã¯ãããããããªãã
sRGBã®JPEGç»åãTIFFç»åãæ±ãå ´åã«ã¯ãåã«ãããRGBã«å¤æãã¦ããå¦çããã°ãããããããç»åã«sRGB以å¤ã®ãããã¡ã¤ã«ãè¨å®ãã¦ããå ´åã«ã¯ã話ãããã¡ãã£ã¨è¤éã«ãªããä¾ãã°Adobe RGBã¯å ¨ã¦ã®è¼åº¦åã§ã¬ã³ã2.4ãé©ç¨ãã¦ãä½è¼åº¦åã®ç·å½¢æ±ãããªããProPhoto RGBã§ã¯ãå ¨ã¦ã®è¼åº¦åã«ã¬ã³ã1.6ãé©ç¨ãããããã£ã¦ããã¡ã¤ã«ã«ä¿åããã¦ããåç»ç´ ã®è¼åº¦ã¯ãããã¡ã¤ã«ã«ãã£ã¦ããªãç°ãªã£ããã®ã«ãªãã-colorspace ãªãã¬ã¼ã¿ã¯ããã対象ç»åã«ãããã¡ã¤ã«ãè¨å®ããã¦ããã°ããããåç §ãã¦ãé©åãªå¤æãè¡ã£ã¦ãããããããããã®å¤æã§RGBã«ãªã£ã¦ãã¾ã£ãç¶æ ã§ã¯ãå ã®ãããã¡ã¤ã«ãä½ã ã£ããã¨ããæ å ±ã¯ããæ®ã£ã¦ããªãããããã£ã¦ãåºåãæ¸ãåºãåã«ããããã¡ã¤ã«æ å ±ãè£ã£ã¦ãããªãã¨ãããªãããã®ããã«ã¯äºããããã¡ã¤ã«ãæ½åºãã¦å¥ã®ãã¡ã¤ã«ã¨ãã¦ä¿åãã¦ããã¦ãå å·¥å¾ã«ãããé©ç¨ãããã¨ã«ãªãããããã¡ã¤ã«ã®é©ç¨ã¯ -profile ãªãã¬ã¼ã¿ã§è¡ãã®ã ããããã¯sRGBè²ç©ºéã®ãã¼ã¿ãåæã¨ãã¦ããã®ã§ããã®åã«RGBè²ç©ºéã®ãã¼ã¿ãsRGBè²ç©ºéã«å¤æããã°ãªããªãã以ä¸ãã¾ã¨ããã¨ãICCãããã¡ã¤ã«ä»ãã®ãã¡ã¤ã«ãå å·¥ããå ´åã以ä¸ã®ãããªæé ã«ãªãã
convert input.jpg input.icc convert input.jpg -colorspace rgb {other operators} -colorspace srgb -profile input.icc output.jpg
ãªãã ããã®ä»æ§ã¯ã¨æããå¤é¨ãã¡ã¤ã«ã¨ãã¦ãããã¡ã¤ã«ãéé¿ããã®ãé¢åã ããäºå¾ã®ãããã¡ã¤ã«ã®é©ç¨ãsRGBãã¼ã¿ã«å¯¾ãã¦è¡ãã£ã¦ã®ã¯ç´æã«åããã®ã§ãã¡ããã¨æ±ãã¦ããã¦ã¼ã¶ã®æ¹ããããå°ãªãããããªããã¨æãã
話ã¯å°ãé¸ããããæ¨ä»ã®ã«ã¡ã©ããã£ã¹ãã¬ã¤ã®é²åãèããã¨ããã¯ãsRGBã§ç¾åããã®ã¯å¿ä½ç¡ããä¾ãã°ãã®ç»åãMacbook Proããã®ä»ã®åºè²åãã£ã¹ãã¬ã¤ï¼Adobe RGB対å¿ãIDC-P3対å¿ï¼ã§è¦ã¦ã»ãããå·¦ãsRGBã§ãå³ãProPhoto RGBãããã¡ã¤ã«ã®ç¾åä¾ã ãåãç»åããã¨ã«Lightroomã§æ¸ãåºãã¦ãããæ»ãå°ã®ç·ã®è²ãå ¨ç¶éãã®ãããããã¨æãã
ç¾å¨å¸å ´ã«ããå¤ãã®ãã©ã¦ã¶ã¯ICCãããã¡ã¤ã«ã«å¯¾å¿ãã¦ããã®ã§è¡¨ç¤ºã«é¢ãã¦ã¯åé¡ãªãããããããããã¡ã¤ã«ä»ãã®ç»åãå å·¥å¦çããã«ããã£ã¦ã¯ã常ã«ãããã¡ã¤ã«ã®æã¡åãã®åé¡ãä»ãã¾ã¨ãããããå«ã£ã¦ç§ã以åã¯sRGBã主ã«ä½¿ã£ã¦ãããããã¯ãå¿ä½ç¡ãã¨æã£ã¦æ¹å¿ãããæè¿ã¯Display P3ãããã¡ã¤ã«ã§ç¾åãã¦ãããProPhoto RGBã¯ç¾æç¹ã§ã¯ãªã¼ãã¼ã¹ããã¯ãããããProPhoto RGBã®ã¬ã³ã1.6ã¯sRGBã®ã¬ã³ã2.4ã¨ä¹é¢ãããã¦ãã¦ããããããã¡ã¤ã«ãå¥ããããæã«è¦ããããã®ãããªããªããå®éããã®ã¯ã¦ãªããã°ã§ã¯ãããã¡ã¤ã«ä»ãã®ç»åã表示ã§ããã®ã ãããããããµã¤ããã¼ãªã©ã«è¡¨ç¤ºããéã®ãµã ãã¤ã«ãçæããéã«ããªãããããã¡ã¤ã«ãå¥ãåã£ã¦ãã¾ãã®ã ãGoogle Photosãé²è¦§ç¨ã®ç¸®å°ç»åãçæããéã«ãåãåé¡ããããã¢ããã¨ããµã ãã¤ã«ã®ãã¼ã¿éãæ¸ããããã®ã¯åããããããããããã¡ã¤ã«ãå¥ãåããã ã£ãããåç»ç´ ã®ãã¼ã¿ã®å¤ãsRGBã«å¤æããªãã¨ãã¡ã¼ãã¿ã¤ã
ã§ãDisplay P3ã¯ã¬ã³ãç¹æ§ãsRGBã¨å ¨ãä¸ç·ã§ãè²åã ãIDC-P3ç¸å½ã«åºããªã£ã¦ãããã®ã§ãå å·¥ã®éã«sRGBã¨åãç¹ã ãçæãã¦ããã°ããã®ã§æ¥½ã ãsRGBæ¯ã§ç·ã ããé®®ããã«ãªãAdobe RGBã¨éã£ã¦ç·ã¨èµ¤ã両æ¹é®®ããã«ãªãã®ãè¯ããIDC-P3対å¿ãã£ã¹ãã¬ã¤ã§è¡¨ç¤ºããã®ã«å¿ è¦ååãªã¹ããã¯ã ãããããããã¡ã¤ã«ãå¥ããããå ´åã§ããè²ãèããªãã ãã§ãè¦èªæ§ã¯ãããªã«è½ã¡ãªãããã®ããã°ã®å¤ãã®åçã¯Display P3ãããã¡ã¤ã«ä»ãã§ãé®®ããã ãã¨è¨ã£ã¦ãããããã¨ããã¾ã«ãããä¸æ¹ã§ãµã¤ããã¼ã®ãµã ãã¤ã«ã¯ãããã¡ã¤ã«ãå¥ãããã¦è²ãèããªã£ã¦ããããã©ããæ°ã¥ããªã人ãã»ã¨ãã©ã ãããã¤ããåãµã¤ãã®éçºè åä½ã«ãããã¦ã¯ãå¾çã ãããããã¡ã¤ã«ä»ãã®ç»åãå£ããªãã§ããã ããããã¡ãªã¿ã«ãImageMagickã§ãããã¡ã¤ã«ä»ãã®ç»åãæ£ããsRGBã«å¤æãã¦ãããã¡ã¤ã«ãå¥ãåã£ããµã ãã¤ã«ãä½ãæé ã¯ã以ä¸ã®ãã®ã ã
convert input.jpg -auto-orient -profile srgb.icc -colorspace rgb -resize 256x256 -strip output.jpg
ãããã¡ã¤ã«ä»ãã®ç»åã« -profile ãªãã¬ã¼ã¿ã使ãã¨ãç»åãã¼ã¿ãæ°ãããããã¡ã¤ã«ã®ãã®ã«å¤æããä¸ã§ãæ°ãããããã¡ã¤ã«ãä»ä¸ãã¦ãããããããã¡ã¤ã«ããªãå ´åã«ã¯ç»åãã¼ã¿ã®å¤æ´ã¯ããã«ãããã¡ã¤ã«ã ããä»ããããã®ã ãããããã«ãããã®ãããã¡ã¤ã«ã¯ -strip ãªãã¬ã¼ã¿ã§æ¨ã¦ããã¦ãã¾ããEXIFã®ç»åå転æ å ±ã失ãåã«-auto-orientã§åããæ£ç«ãããã®ãéè¦ã ã
ãã®æé ã ã¨sRGBã®ICCãããã¡ã¤ã«ãå¿ è¦ãªã®ã ããconvert some_srgb_image.jpg srgb.icc ã¨ããã£ã¦æ¢åã®sRGBãããã¡ã¤ã«ä»ãç»åããã¨ã¯ã¹ãã¼ããã¦ãããããUbuntuã¨ãã®ãã£ã¹ããªãã¥ã¼ã·ã§ã³ã ã£ãã apt-get install icc-profiles ã¨ããã㨠/usr/share/color/icc ã®ä¸ãããã«å種ãããã¡ã¤ã«ãã¤ã³ã¹ãã¼ã«ãããã®ã§ãããã使ã£ã¦ãããã
ã¾ã¨ãããæ軽ãã¤å ¨èªåã§æè»ãªç»åå¦çãã§ããImageMagickã¯å大ãªãã ãã©ãã¬ã¤ã¤ã¼ãä½ããã¦å ¨ããã£ã¦ã¨ã³ãã¦ã¼ã¶åãã§ã¯ãªããã¹ãã«ã¿ã³ãªãã¨ã¯åãã£ã¦ãããã¨ã ãã©ããªããªãã§ããããã¯ã