ããããç»åãåãåºãã¦ãããã·ã§ã«ã¹ã¯ãªãããçµãã :
ãã®ã¹ã¯ãªããã®å©ç¹ã¨ãã¦ä»¥ä¸ãæããã:
- OSä¸ã§ç´æ¥ç»åãå¾ããã
- 1æã®ç»åãå¾ãããããæ¯è¼ãããã
- é«éã«åä½ãã
ãã ãæ¬ ç¹ããã:
- ã³ã¼ãã¯é-åç¨å©ç¨ã§ã®å©ç¨ã«éããã
ã¹ã¯ãªããã¯æ«å°¾ã«ç½®ãã¦ããã®ã§ã説æã«èå³ãç¡ã人ã¯éä¸ã¾ã§é£ã°ãã¦ãã ããã
- è²è¦ç¹æ§ã¨ã¯
- Peacockã使ã£ã¦è²è¦ç¹æ§ã«ãã¨ã¥ãè¦ãæ¹ã確èªãã(ãªãæ¢åã®ãã¼ã«ã使ããªãã)
- ImageMagickã§è¤æ°ã®ç»åãã¢ã³ã¿ã¼ã¸ã¥ãã
- ã·ã§ã«ã¹ã¯ãªããåãã
- å®éã«ã°ã©ããã¢ã³ã¿ã¼ã¸ã¥ãã¦ã¿ã
- ã¾ã¨ã
- ãã¾ã
å
¬ç§ã¨ãã«1Passwordã®ãªã¼ããã£ã«ã«ããªãé ¼ã£ã¦ããããã¾ãä¼ç¤¾ã§ã¢ã¯ã»ã·ããªãã£ã«ã¤ãã¦ä¼è©±ããSlackãã£ã³ãã«ã§ãã #accessibility
ãæ´»çºã«æ´»åãã¦ãããã¨ã身ã®åãã§ã¢ã¯ã»ã·ããªãã£(accessibility, a11y)ãæèãããã¨ãå¢ãã¦ããããªãã§1Passwordãã¢ã¯ã»ã·ããªãã£ã«é¢ä¿ããã®ãã¨ããã¨ã1Passwordã¯HTMLä¸ã®ãã©ã¼ã ã®å±æ§ãããªãç´°ããè¦ã¦ãã¦ãã©ã®ãã£ã¼ã«ãã«ä½ããã£ã«ãã¦ããããå¤å®ãã¦ãããããåºãæå³ã§ã¯ã¢ã¯ã»ã·ããªãã£çãªæè¡ã«å
¥ãã¨èãã¦ããããã ã
ãã¡ãã¨ãã£ã¼ã«ãã«å±æ§ãå ¥ã£ã¦ããã°ããã©ã¦ã¶ã¯ããã«å¿ãã¦ãããã
è²è¦ç¹æ§ã¨ã¯
ãã¦ãè²è¦ç¹æ§*1ã¨ããã®ããã£ã¦ãç¹å®ã®è²ãè¦ãã«ããã£ããããã¨ãã人ããããè±èªã§ã¯color blindnessã¨å¼ã¶ãããã
ç·æ§ã®æ°%ã¯ãã®ç¹æ§ãä¿æãã¦ããã¨ããã
ãªãã§ç»åã®ã¢ã¯ã»ã·ããªãã£ãæ°ã«ãªã£ãã®ãã¨ããã¨ãå æ¥Zstandardã¨ããå§ç¸®æè¡ã®è¨äºãæ¸ããã®ã ã:
ãã®ã°ã©ãã£ã¦æ¬å½ã«è¦è¦ã使ããå ¨ã¦ã®äººã«ã¨ã£ã¦è¦æãã®ããªãã¨ãããã¨ãæ°ã«ãªã£ã¦ããããã§ããã
ãã¡ãããè¦è¦ã使ããå ¨ã¦ã®äººã«ã¨ã£ã¦ããããããã°ã©ãã«ãªã£ã¦ãããã¨ãæã¾ããã
Peacockã使ã£ã¦è²è¦ç¹æ§ã«ãã¨ã¥ãè¦ãæ¹ã確èªãã(ãªãæ¢åã®ãã¼ã«ã使ããªãã)
ãã¡ãããè²è¦ç¹æ§ã«åºãã¦ãã¼ã¸ã表示ãã¦ãããChromeæ¡å¼µæ©è½ã¨ãããã¾ãã¾è²è¦ã®ãã¨ã§ç»åãã©ãè¦ãããããªã³ã©ã¤ã³ã§ç¢ºèªã§ãããµã¤ããªã©ããããã以ä¸ã®ãããªä½¿ãåæã®æªããæãã¦ãã:
- ä»äºã§ä½¿ã£ã¦ããææç©ããä»äººã®ãµã¤ãã«ã¢ãããã¼ãããããã«ã¯ãããªã
- Chromeæ¡å¼µã¯ä¸åº¦ã«1ã¤ã®ç¹æ§ã«ããè¦ãæ¹ãã確èªã§ããªã
- Chromeæ¡å¼µã¯DOMã®è¦ãæ¹ãä¿®æ£ããã ããªã®ã§ããã®æ§åãä»äººã«å ±æããããã«ã¯ã¹ã¯ã·ã§ãªã©ãå¿ è¦ã§ãã
ããã§ãç´æ¥OSã®ä¸ã§ç»åãå¤æã§ããæ¢åã®ãªã¼ãã³ãªå®è£ ãæ¢ãã¦ã¿ãã¨ããã以ä¸ã®OSSãçºè¦ã§ãã:
ãã®OSSã使ã£ã¦ãç»åãçæãã¦ã¿ããã¨ã«ããã
ãã ãã以ä¸ã®ã©ã¤ã»ã³ã¹æ¡é ããã:
The conversion processes and coefficients herein are used with permission from Colblindor and were therein used with permission of Matthew Wickline and the Human-Computer Interaction Resource Network for non-commercial purposes. As such, this code may only be used for non-commercial purposes.
éåç¨å©ç¨ã«éã£ã¦ä½¿ããã¨ãã§ããã¨ã®ãã¨ã ãããã®ç»åã¯ã©ãè¦ããããªããã¨æ¥åæéä¸ã«ç¢ºèªããã®ã¯ãã©ã£ã¡ã«ãªãã®ãæ°ã«ãªããéåç¨å©ç¨ã®å¢ç®ã¯é£ããã
Peacockã®ã¤ã³ã¹ãã¼ã«
Peacockã«ã¯C++çã¨Pythonçã¨ããããå¥ã«ã©ã¡ãã使ã£ã¦ãè¯ãã®ã ããä»åã¯C++çã使ããã¨ã«ãããC++çã®ã¤ã³ã¹ãã¼ã«ã®ããã«ã以ä¸ã®ãããªã½ããã¦ã§ã¢ãã©ã¤ãã©ãªãå¿ è¦ã¨ãªã:
libMagick++
ã¨ãã®ããããã¡ã¤ã«(ããã¦ãã®ãã£ã¹ããªãã¥ã¼ã·ã§ã³ã§libMagick++-devel
ã¨ãã£ãååã«ãªã£ã¦ããã¯ã)- CMake
- g++(ä»ã®ã³ã³ãã¤ã©ã§ãåãã¯ã)
ä¾åé¢ä¿ãå ¨ã¦æãããã以ä¸ã®éãã«å®è¡ãããã¨ã§peacockããã«ãã§ãã:
$ cd cpp $ mkdir build $ cd build $ cmake ../src $ make
èªåã®ç°å¢ã§ã¯ãã¾ãImageMagickãèªèã§ããªãã£ãã®ã§ãcmake
ã«ä»¥ä¸ã®ãããªãªãã·ã§ã³ãã¤ãã¦å®è¡ãã:
$ cmake ../src -DImageMagick_Magick++_INCLUDE_DIR:PATH=/usr/include/ImageMagick-7 -DImageMagick_Magick++_LIBRARY:FILEPATH=/usr/lib64/libMagick++-7.Q16HDRI.so
make
ã¾ã§ã®æé ãçµããã¨æå
ã«peacock
ã¨ãããã¤ããªãçæããã¦ããã®ã§ãæã§é©å½ãªå ´æã«ã¤ã³ã¹ãã¼ã«ãã:
$ sudo install peacock /usr/local/bin
ããã§ã¤ã³ã¹ãã¼ã«ã¯å®äºããã
Peacockã使ã
å®éã«peacockã使ã£ã¦ã¿ãããpeacock
ã³ãã³ãã«ç»åãã¡ã¤ã«ã®ãã¹ã渡ãã¨ãCB_
ã¨ãããã¬ãã£ãã¯ã¹ã®ã¤ããç»åãããããçæãããããããã®ä¸æä¸æãããããã®è²è¦ç¹æ§ã«å¯¾å¿ãã¦ãã(ãã¡1æã¯Normalãã¤ã¾ãä¸è¬äººã®è²è¦ã«ãªã£ã¦ãã)
$ peacock IMG20220525102718.jpg Processing: IMG20220525102718.jpg Performing conversion to ALL representations of colorblindness... Performing conversion to Normal... Writing CB_Normal_IMG20220525102718.jpg... Performing conversion to Monochromacy... Writing CB_Monochromacy_IMG20220525102718.jpg... Performing conversion to Protanopia... Writing CB_Protanopia_IMG20220525102718.jpg... Performing conversion to Deuteranopia... Writing CB_Deuteranopia_IMG20220525102718.jpg... Performing conversion to Tritanopia... Writing CB_Tritanopia_IMG20220525102718.jpg... Performing conversion to Protanomaly... Writing CB_Protanomaly_IMG20220525102718.jpg... Performing conversion to Deuteranomaly... Writing CB_Deuteranomaly_IMG20220525102718.jpg... Performing conversion to Tritanomaly... Writing CB_Tritanomaly_IMG20220525102718.jpg...
ãã¡ã¤ã«åã¯ãCB_ç¹æ§å_å
ç»åå
ã®å½¢å¼ã§åºåãããã
ImageMagickã§è¤æ°ã®ç»åãã¢ã³ã¿ã¼ã¸ã¥ãã
ãã¦ãè²è¦ç¹æ§ã«åºããç»åãå
¥æãããã¨ãã§ãããããã®ã¾ã¾ã ã¨ããã®è²åãã¯ã¢ã¯ã»ã·ãã«ããªããã¨ãã£ãæãã§ã¨ã³ã¸ãã¢ããã¶ã¤ããçºããç¨éã«ã¯é©ãã¦ããªãã®ã§ããããã1æã®ã¢ã³ã¿ã¼ã¸ã¥ã«çµ±åããããããããImageMagickã«ã¯montage
ã¨ããã³ãã³ããç¨æããã¦ãããè¤æ°ã®ç»åãç¹å®ã®æ¹æ³ã§1æã«ã¢ã³ã¿ã¼ã¸ã¥ãããã¨ãã§ããã
以ä¸ã®ã³ãã³ããç¨ãã¦ãè¤æ°ã®ç»åãã¢ã³ã¿ã¼ã¸ã¥ãã:
$ montage -label '%f' -frame 10 -tile 4x2 -geometry x400 CB_*.jpg montage.jpg
åãªãã·ã§ã³ã®èª¬æã¯ä»¥ä¸ã®éã:
-label '%f'
ãã¡ã¤ã«åããã¬ã¼ã ã«ã©ãã«ã¨ãã¦è¨è¼ããã-frame 10
ç»åã«å¯¾ãã¦å¹ 10pxã®ãã¬ã¼ã ã追å ããã-tile 4x2
4å2è¡ã®ã¢ã³ã¿ã¼ã¸ã¥ãè¡ãã-geometry x400
ç»å1æããã縦400pxã¨ãã(2è¡ããã®ã§800pxã«ãªãããã¬ã¼ã åã§ããå¢ãã¦æçµçã«872pxã«ãªã)ã
ããã«ãããåé ã®ãããªç»åãå¾ãããã
ã·ã§ã«ã¹ã¯ãªããåãã
Peacockã«ããç»åçæã¨ã¢ã³ã¿ã¼ã¸ã¥åãæåã§ããã®ã¯å¤§å¤ãªã®ã§ãç»åã渡ãã ãã§ã¢ã³ã¿ã¼ã¸ã¥ã¾ã§ãã£ã¦ãããã·ã§ã«ã¹ã¯ãªãããä½æããã
#!/bin/bash # Generates color blindness comparison montage from $1. # Outputs `CBM_$1` to current directory (if exists, overwritten without warning). set -ex FILE=${1?Please specify file name as first argument.} ABS_FILE=$(realpath "$FILE") ABS_PATH=$(dirname "$ABS_FILE") FILENAME=$(basename "$FILE") EXT="${FILENAME##*.}" TMPDIR=$(mktemp -d) cd "$TMPDIR" || exit 1 cp "$ABS_FILE" "$FILENAME" peacock "$FILENAME" montage -label '%f' -frame 10 -tile 4x2 -geometry x400 CB_* "cbm.$EXT" mv "cbm.$EXT" "$ABS_PATH/CBM_${FILENAME}" rm -rf "$TMPDIR"
ãããå®è¡ããã¨ãå
¨èªåã§CBM_渡ããç»åãã¡ã¤ã«
ã¨ãããã¡ã¤ã«ã«ã¢ã³ã¿ã¼ã¸ã¥ãçæãããã
å®éã«ã°ã©ããã¢ã³ã¿ã¼ã¸ã¥ãã¦ã¿ã
ãã¦ãæ¬é¡ã«æ»ã£ã¦ãå æ¥æ¸ããè¨äºã®ã°ã©ããã¢ã¯ã»ã·ãã«ãã©ãã確èªãã¦ã¿ãã
windymelt% ./generate-color-blindness-montage.sh 20221010115140.png + FILE=20221010115140.png ++ realpath 20221010115140.png + ABS_FILE=/home/windymelt/Downloads/20221010115140.png ++ dirname /home/windymelt/Downloads/20221010115140.png + ABS_PATH=/home/windymelt/Downloads ++ basename 20221010115140.png + FILENAME=20221010115140.png + EXT=png ++ mktemp -d + TMPDIR=/tmp/tmp.QTijEfrp4K + cd /tmp/tmp.QTijEfrp4K + cp /home/windymelt/Downloads/20221010115140.png 20221010115140.png + peacock 20221010115140.png Processing: 20221010115140.png Performing conversion to ALL representations of colorblindness... Performing conversion to Normal... Writing CB_Normal_20221010115140.png... Performing conversion to Monochromacy... Writing CB_Monochromacy_20221010115140.png... Performing conversion to Protanopia... Writing CB_Protanopia_20221010115140.png... Performing conversion to Deuteranopia... Writing CB_Deuteranopia_20221010115140.png... Performing conversion to Tritanopia... Writing CB_Tritanopia_20221010115140.png... Performing conversion to Protanomaly... Writing CB_Protanomaly_20221010115140.png... Performing conversion to Deuteranomaly... Writing CB_Deuteranomaly_20221010115140.png... Performing conversion to Tritanomaly... Writing CB_Tritanomaly_20221010115140.png... + montage -label %f -frame 10 -tile 4x2 -geometry x400 CB_Deuteranomaly_20221010115140.png CB_Deuteranopia_20221010115140.png CB_Monochromacy_20221010115140.png CB_Normal_20221010115140.png CB_Protanomaly_20221010115140.png CB_Protanopia_20221010115140.png CB_Tritanomaly_20221010115140.png CB_Tritanopia_20221010115140.png cbm.png + mv cbm.png /home/windymelt/Downloads/CBM_20221010115140.png + rm -rf /tmp/tmp.QTijEfrp4K
ã°ã©ãã¯å¤ãã®å ´åã§èå¥å¯è½ã ã£ãããå®å ¨ã«ç½é»ã®å ´åã¯ããè¦é£ãã¨æãããã¢ã¯ã»ã·ãã«ãªã°ã©ããä½æããã«ã¯ã模æ§ãä½µç¨ããã»ããè¯ãããã¨ããç¥è¦ãå¾ãããã模æ§ãçæãããã¨ã§ãä¾ãã°ç½é»ã³ãã¼ãè¡ãã¨ãã£ãå ´åã«ããã®ã¾ã¾ä½¿ããã¨ãã§ãã¦ãä¸è¬äººã«ã¨ã£ã¦ãæçãªãã¨ãå¤ããããã¦ãæåã§èå¥ã§ããå¡ä¾ãæ·»ä»ããã®ã¯ã»ã¼å¿ é ã ã¨ããããããè¯ãããã«ã¯ãå¡ä¾ã®ã©ãã«ãã°ã©ãã®ä¸ã«ç´æ¥æåããã»ããããããSeabornã§ãããã§ãããã¯ããããªãã£ãã
ã¾ã¨ã
è²è¦ç¹æ§ã«ãã¨ã¥ããè¦ãæ¹ãä¸æã§ããã¹ã¯ãªãããä½æããããã®ã¹ã¯ãªããã§ããã¢ã¯ã»ã·ãã«ãªä¸çãåºããã¨è¯ããªã¨é¡ã£ã¦ããã
ãã¾ã
*1:è²ç²ã¨ãè²å¼±ã¨å¼ã¶ãã¨ãå¤ã