45
Grokking the GIMP by Carey Bunks

Grokking thegimp

Embed Size (px)

Citation preview

Page 1: Grokking thegimp

Grokking the GIMP��������� � ������� ����� ���

by Carey Bunks

��� �"!�#%$&')(+*-,.( /0(132547698 *;:<*=( > �? ,A@B/0@DCFEHGFIKJ

LNMPORQTS"U<S"Q;S"V<WYXZS"M\[][ @ LN[_^

Page 2: Grokking thegimp

`baHced�fgihkjilbmnporq�sutwv xzy|{z}~o�{kv ���e�����+� q����"���u��� v �u��{kv o��H�uv �������|�� ��o��R{u{wy�� � �R{ky�ortnpo��|{b���R{b��uv ��{�o��z��v xz��t�����uv ��{�o��u������� ����rt����b�u�u�� ������o�� � ����x���� ���|{�������-�����

 ¢¡ ouor�=�¤£���t¥£�v �|�  � o����|�en=� v ���¦�  ���u����{§v o��H}i��� ����¨ � ���u����¨������Z©7��su��ou��t��Fª7y�ort¥{b���|{��  ªr��{«{§v ��x¬��qK­®o��ut�npo��eqr�|{b��t�{bo"¯=��{u{wy�� � o���{u�kt°or�±{wy��H¯�² � �  }�o�{³���;o�� ���-�  }�o�{³���;o��N´iv �r��o ���=�  }�o�{³���;o��Kª��=��q"�����+¯�² � � � ���Tort¥s � �����uxr��� ���|{  �|o��u�7v ��xZ��o��R{b�  ªr��{«{§v ��x"{wy��TµF¶\v ����o��±ª�s���{b���±{�o � �u� � o�tb� �ry����K·]�rq�q  ª�o���t��u���;o�� � ���¸² � �ux�� � ��{³��tkv ��� �  �ry��]¹¤v �5{bo�t«s o��u{wy��H¯�² � �º ��v {¼»K½�¯�² � � ¡ ����v ���»�¾�»�² �R{§t°o��z����v ��x"{wy��H¯K² � � ¶\v ����o��±����� � v ��� o�xr�»�¾�»�¾�»¿�ry�� ��o�or� ��o�À»�¾�»�¾ Á��ry��F² � �uxr�T¶<v ���ro��»�¾�»�¾ Â��ry��]����s���t���¨�n-y����u����� �u¨�����������{ky�� � v ��� o�x��»�¾�»�¾ Ã��ry�� � v ��� ouxr�=��ort�npo�� ortk¨ ¡ t³����y�����¨u����{°{b��t³����¨�¯ t��u�7v ���|{��u¨|�������u��� ��{«{³���»�¾ Á���o����®v ��xF�����Fª���£uv ��xIJ � �ux����»�¾ Âin=tb����{kv ��xZ}i���¸² � �uxr���»�¾ à � ¯ ¡ ¨�¯Ttb��s��|�u��� �r¨|�����IJ ���r��À����IJ¥�T�ux����»�¾ Å º ���ro�v ��xF����� � �u�ro�v ��x»�¾ Æ � �u�u��� � v ��x"{ky��]�����5{z�uv � {b��t � v ��� oux»�¾ Çinporq�s�¨�n-�R{Ȩ|�������u����{b� ¡ �R�°�b��t°�»�¾ ·~Ézouo��0�����Z}i�|�Ê´�v �|�»�¾ ·r¾�»¦É�ouor�

Page 3: Grokking thegimp

Ë�Ì ÍrÌ Î�Ï�Ð�ÑÓÒiÔ Ð�ÑË�Ì Õ¼Ö�×�Ð]ØiÐ�Ù Ú"Û�Ü�Ý5ÞbÐ�ßË�Ì�ËRà|ápârß�ßTâ�ã"ärå°ârærÙ Ð�ßTÝTç�ã�èZéuå�Ðuê7ë�Ð�ã|ÞkÙ ÜNìíÝ�î5Ð�è+ïTë�Ð�Ý5Þ§Ô â�ã�Ýðpã�Ô Þ�ÎFñ�ò7Ð�óuÔ Ð|Ñôâ�õzö�ç�Ü�Ð�å�ÝÎ�Ì�Ëiö�ç�Ü�Ð�å°ÝTç�ã�è"Þw×�Ð]òzârÙ Ð Ör×�Ð�Ü"ä�Ù ç�ÜHÔ ã]÷¥ßTçuø�Ð�ÝÎrÌbË�ÌbËBÖ�×�Ð]ö�ç�Ü�Ð�å°Ý�ù¤Ô ç�Ù â�øÎrÌbË�Ì Î�Ö�×�Ð]ö�ç�Ü�Ð�å°ÝeúTÐ�ã�ëÎ�Ì Î�á-×�ç�ãuã�Ð�Ù ÝTç�ã�è"Ör×�Ð�Ô årò7Ð�Ù ç�ÞkÔ â�ã�Ý�×�Ô Ú�Þ�â_ö�ç�Ü�Ð�å°ÝÎrÌ ÎrÌbËBÖ�×�Ðeá�×�ç�ã�ã�Ð�Ù Ý�ù¤Ô ç�Ù âuøÎ�Ì û=ö�ç�Ü�Ð�å�á=å�Ðuç�ÞkÔ â�ã�ü�ùiÐ�Ù Ð�ÞkÔ â�ã�ü�ùpë�ÚrÙ Ô ý�ç�ÞkÔ â�ã�ü�ç�ã�è+þ å�ø�ç�ã�Ô ÿ�ç�Þ§Ô â�ãÎrÌ û�ÌbË5á=å�Ðuç�ÞkÔ ã�øZÏiÐ|Ñ0ö�ç�Ü�Ð�å°ÝÎrÌ û�Ì Î�ò7ç�Ô Ý�Ô ã�øZö�ç�Ü�Ð�å°ÝÎrÌ û�Ì û�ö�â�Ñ=Ð�åwÔ ã�øZö�ç�Ü�Ð�å°ÝÎrÌ û�Ì �rùpë�ÚrÙ Ô ý�ç�ÞkÔ ã�øZö�ç�Ü�Ð�å°ÝÎ�Ì �Tö�ç�Ü�Ð�å�����Ú�ârå¥Þ�ç�ã�èÄ÷ ßeÚ�ârå¥ÞÎ�Ì �=éuÙ â�ç�ÞbÝÎrÌ ��ÌbË ì�ë|Þ�ârß ç�Þ§Ô ýeá=å�Ðuç�Þ§Ô â�ã â�õzé�Ù âuç�Þ�ÝÎrÌ ��Ì Î�����Ú�Ù Ô ý�Ô Þ�á=å�Ðuç�Þ§Ô â�ã â�õzéuÙ â�ç�ÞbÝÎrÌ ��Ì ûRì�ã�ý�×�âråwÔ ã�øZéuÙ âuç�Þ�ÝÎ�Ì �;úTç�ãuÔ Úrë�Ù ç�ÞkÔ ã�øZö�ç�Ü�Ð�å�ÝÎrÌ �rÌbË�äuâuÝ�Ô Þ§Ô â�ã�Ô ã�øZö�ç�Ü�Ð�å�ÝÎrÌ �rÌbË�ÌbË�ú;â�óuÔ ã�øZö�ç�Ü�Ð�å°ÝÎrÌ �rÌbË�Ì Î�ì-Ù Ô ø7ã�Ô ã�øZö�ç�Ü�Ð�å°Ý-Ñ Ô Þk×�TëuÔ è�Ð�ÝÎrÌ �rÌbË�Ì û�Ö�â�ørø®Ù Ô ã�ø"Þw×�Ð]ö�ç�Ü�Ð�å�zâ�ë�ã�è�ç�å«ÜÎrÌ �rÌ Î�ò7Ð�Ý�Ô ÿ�Ô ã�øFç�ã�èFÛ�ý�ç�Ù Ô ã�øÎrÌ �rÌ ÎrÌbË�÷¥ßTçuø�ÐeÛrýuç�Ù Ô ã�øÎrÌ �rÌ ÎrÌ Î�÷¥ßTçuø�Ð]ò7Ð�Ý�Ô ÿuÔ ã�øÎrÌ �rÌ ÎrÌ û�ö�ç�Ü�Ð�å�Û�ýuç�Ù Ô ã�øÎrÌ �rÌ ÎrÌ ��ö�ç�Ü�Ð�årò7Ð�Ý�Ô ÿuÔ ã�øÎrÌ �rÌ û�éuÙ Ô Ú�Ú�Ô ã�øÎrÌ �rÌ �ròzâ�Þbç�ÞkÔ ã�øZÔ ãKÕuà��¤÷ ã�ý�åbÐ�ß Ð�ãRÞbÝÎrÌ �rÌ �|Ö�×�Ð Ö�åbç�ã�Ý5õbâ�åkß±Ö�â�ârÙÎrÌ �rÌ ��ÌbË�òzâ�Þbç�ÞkÔ â�ãÎrÌ �rÌ ��Ì ÎuÛ�ýuç�Ù Ô ã�øÎrÌ �rÌ ��Ì û�Û7×�Ð�ç�åwÔ ã�øÎrÌ �rÌ ��Ì �zä�Ð�å°Ý�Ú�Ðuý�Þ§Ô ó�Ð

Page 4: Grokking thegimp

�� ���������� ��� ���������� "!$#

�� ���&%�'( �!$�)� ���

�� ��� "*,+ ��-.-& "��� ���

�� /�������(���10�!2����+ ��(#(�"��3�*,!$ ,465� "�7-8+ �:9;#�<= >3@?(5� >#=-A� �"��#

B���� -�CED7F� �+ ,G�-A� �"��#

C��$%�H�I� KJ6��#>� GLF� "+ ,G�-8� ���MH"�>��+ #

C��$%��$%NH�I� LF)� OF� �+ ,G�-8� ���MH��,��+ #QP8!2���R-8I� SH"�,��+ �,��O

C��&%��&%��&%NH�I� KT6 ,G�-&�"���)+ LF� "+ >G�-�����3VU�+ + � W�#7 LF� �+ ,G�-,H"�>��+ #

C��&%��&%�� �H�I� K���>#X#7�KY.-ZI� K*,!$ , �[]\^����3_F� "+ ,G�-8� ���MH"�>��+ `

C��&%��&%�� C�H�I� E'(�,�)� G(aV����3bY.-8I� K*>57cXc7�dF� �+ ,G�->H"�,��+ `

C��&%��&%�� e�J6 �c�� �!f0,��-ZI�#

C��&%��&%�� g�H�I� _h �X-i "+ + � �� ��7-�F�G�� #7#X��!2#

C��$%�� ,F� �+ ,G�-A� ���MH��,��+=jSW>-8� ����#

C��&%�� ��&%k9l�X-A� ��+ � �>#�� ���

C��&%�� �� �*� >��-ZI� �!Z� ���

C��&%�� �� C>F��"�mW�+ E'( �!$�� ,3

C��&%�� �� e>H�I,!& �#�I���+ 3

C�� ;�����L��� �,� ���_F� �+ >G�-8� �"��#

C�� ��$%k9;3�3)� ���

C�� �� ,Ff5��>-8!$�,G�-8� ���

C�� �� C�h �7-& �!2#7 ,G�-8� ���

C�� �� e�Bn#>� ���o9�3�3qp�Ff5��>-8!$�,G�-Ap�����3rh �7-& �!2#� ,G�->sS� -ZIM-8I� KT6 ,G�-i�����)+ L�"��3VU�+ + � W,#� LF� �+ ,G�-8� ���MH"�>��+X*� ,��-85,!& �#

C�� �� g�':��t�� ���_�LF� �+ ,G�-A� ���oJ���5,��3���!u�

C�� CqH�I� LF� �+ ,G�-f'( "�>5d�"��3�*,!Z� "��3�#

C�� C��$%NH�I� _h �7t� �!u-f*>5>��G�-8� ���

C�� C�� �H�I� :9v+ +X*>5>��G�-8� ���

C�� C�� C�H�I� owx�"�� o*>5>��G�-8� ���

C�� C�� e>H�I� o*>+ �,��-�*>5>��G�-8� ���

C�� C�� g�H�I� o*� ,��-ZI� "!�*>5,��G�-8� �"�

C�� C�� y�H�I� dFfI���!ZW" "�*>5,��G�-8� �"�

C�� C�� ��H�I� dFfI�!Z� �,<:*>5>��G�-8� ���

C�� C�� /�H�I� zS!2��s{*>5>��G�-8� ���

C�� C�� |�H�I� oJf��!&3� �!�*�5,��G�-A� �"�

C�� C��$%X}7H�I� dF���t� S-$�o�vI��"�>�� �+~*�5,��G�-A� ���

C�� C��$%,%kH�I� oJ��d����+ ��!�*�5,��G�-A� �"�

C�� C��$%~ �H�I� MH"�_0���-8I*�5,��G�-A� ���

Page 5: Grokking thegimp

��� ���$�X�7�����M�"�����)� �L���"� �>���8� ����>�>�����8� ���

��� ���$�����������,�7�v�7�A�����������>�=�&�

��� ���$�X���"�8�2���=�

��� �6� �����E�����8������ ��� ���

��� �6�$�N�����E�����8���L���"� ���2�&�

��� �6� �������L���"�7�8�$�����,��� �X�6�M�,���K q�7�.�$�����

��� �6� �������E�����8���L�(�"�>�

��� �6� �>�����E�����8��� q�7�.�$���o 6�"�

��� ��¡x�>� ���_����� �,���A� �����L¢�£.£i�>���8� ¤���� �

��� ���$�X¥Q�"���"�&�"�=���"� �>���8� ���M�"�>���~¥M��� ����� � �����

��� ��� �����,���������N¦i�������8� ���

��� ��� �"¡n�>� ���o§f�,��¨

��� ��� �"����� �,���A� �����(�"���@¥M��� ���>�

��� ©;����¨L¨(�"�1���2��ª�� ��¨M�(�"�����>�&�>«6�����7�8� �:¬;�>���,�@­(���>�~�8� �����

¡���� �,�b®>�(�>�����

�6�$�q�v�����,���"���(���>�N�

�f�&���&�k�����L�l���"�>����� ���� �"� �,�

�f�&��� �>����¤,� ���_���"� �,���8� �����Q�$�o�v���"�,�������M�>�>�N�

�f�&��� �"�(���X� ���_�v�����,���"���(���>�N�v¯^� �>� ª�� �

�f�&��� �������.�8� ���_�L�v�����,���"���(���>�~° �M����� ���8�~���&�����>�����$�"�����"�������1�f� �8� �

�f�&��� �7�����L�l���"�>����� �L�(���,�

�f�&��� ©>����¨Lª�� ��� ���_�v���"�,����� �

�f�&��� ±"�����u�8� ��� � �d����� �,���i�>�V��� ²>�"� �

�6� �:³����������(�>�����

�f� ���&�=�Q�$�,���8� ���_�K³������"�f�(�>���

�f� ��� ���(�"�,� ����� ���8� ���1�Z���K³����������(�>���

�6� �Q 6���>� �S�"�,��� �Q£&����´����Z�X� ���oµS� �8�d�v���"�,�������"����³������"�f�(���>���

�f� ���&������� �X�A� ���1���,��� �

�f� ��� �>����� �>���8� �"�M�"�,��� �

�f� ��� �>¥S�$�,�)� �"�X�&�

�f� ��� ���f�$�"�����"�"�&�������d���(�S�"�>���k£$����¢��)� �8� ���V�(�>�����

�f� ��� �� n� ���Z�8� ���E��£6�(���>�N�(�"���@¶��8�����f¢�£2£&�,���&�

�6� �Q�����X¤��"�$��� �����M��£����"� �,���8� �����>���v���"�,�������M�>�>�N�,��³��������f�M�>�>�N�,�7�"���o¬l� �����L�"���"�,����� �

�6� �:�(�>�����M�"���_����� �,���8� �����

�f� ���&�7¡x�>� ���V�(�>�����Q�$�E·6��£8� ���L���"� �,���8� �����

�f� ��� �������o­M��� ���(�(���>�

Page 6: Grokking thegimp

¸f¹ º�¹ »�¼,½ ¾�¿6½ ¾�À1Á8Â�ÃKÄ^Å�ÁZÆ�Ç$Å�È7É(Å>Ê�Ë

¸f¹ º�¹ »�¹&ÌkÍ�Î�ÇZË7½ ¾�ÀoÏ(½ ÁZÂMÁZÂ�ÃSÐ�Â,Ç&Ã�Ê�Â�Î�È ¿1Ð"Î,Î�È

¸f¹ º�¹ »�¹ Ñ�Ð�Â�Ã:Ð�Â�Ç$Ã>Ê�Â�Î�È ¿LÐ"Î>Î�ÈÓÒqÃ�Ç2Ê�Æ�ÊQÁ8Â�Ã1É(Å,À)½ Ô(ÍVÅ�¾�¿

¸f¹ º�¹ »�¹ »�Ð�Â�Ç$Ã>Ê�Â�Î�È ¿_Å�¾�¿�Õ^Ã>Ô>Î�ÖL×,Î,Ê�Ã

¸6¹ ØlÙ�Î�ÖÖ(Î�¾1Ú�Ç2Î�Û�È Ã�Ö(Ê(Å"¾�¿�¼,Ç$Ã,Ü6Æ�Ã"¾7Á8È Ý:Þ;Ê�Ë=Ã>¿@ß(Æ�Ã>Ê=ÁA½ Î"¾�Ê

à�¾�½ Á�ºEá Ù�Î�È Î�Ç2Ê>×�Å,Ô,Ã�Ê(Å"¾�¿�âqÈ Ã�¾�¿)½ ¾�ÀVÉMÎ�¿�Ã�Ê

º�¹$Ì�Ð�Â�ÃKã)ä(â�Ù;Î�È Î�Ç2Ê>×�Å,Ô,Ã

º�¹ ÑnÐ�Â�ÃKå^æ,ÒVÙ�Î�È Î�Ç2Ê>×�Å,Ô,Ã

º�¹ »�ã6Ã�È Å�Á8½ ¾�À�å^æ,Ò@Á&ÎEã)äSâ

º�¹ ¸^Ð�Â�ÃLæfÆ�Û>Á8Ç$Å,Ô�Á8½ ç�ÃLÙ�Î�È Î�Ç"æ"Ý�Ê~Á&Ã�ÖMÊ(Ù:ÉvèqÅ�¾�¿_Ù:Évèxé

º�¹ º^Ù�Î�¾7ç�Ã�Ç2Ê>½ Î"¾MÁ&Î1äSÇ$Å�Ý�Ê�Ô>Å�È Ã

º�¹ ØnÐ�Â�ÃKânÈ Ã�¾�¿)½ ¾�ÀVÉMÎ,¿�Ã>Ê

º�¹ Ø�¹$ÌNÐ�Â�ÃKÄxÎ�Ç8ÖSÅ"È ê�Õ�½ Ê7ÊXÎ�È ç�Ã�ê�Å"¾�¿�â6Ã"Â,½ ¾�¿�ânÈ Ã"¾�¿6½ ¾�ÀVÉMÎ�¿�Ã>Ê

º�¹ Ø�¹ Ñ�Ð�Â�Ã:Þ�¿�¿)½ ÁA½ Î"¾�ê�æfÆ�Û>Á8Ç$Å,Ô�Á8ê7Å"¾�¿�Õ�½ ë.ë&Ã�Ç$Ã"¾�Ô>ÃKânÈ Ã"¾�¿)½ ¾�ÀVÉMÎ,¿�Ã>Ê

º�¹ Ø�¹ »�Ð�Â�Ã1ÉdÆ,È Á8½ ×�È ÝLì8âqÆ�Çi¾�íîê>Õ�½ ç,½ ¿�Ã1ì8ÕxÎ�¿�À�Ã>íïê�æ�Ô�Ç$Ã,Ã"¾�ê7Å"¾�¿_ðlç�Ã"Ç8È Å�ÝânÈ Ã�¾�¿)½ ¾�ÀVÉ:Î�¿�Ã>Ê

º�¹ Ø�¹ ¸>Ð�Â�ÃoÕ^Å"Ç8Ë�Ã"¾ð(¾,È ÝMÅ"¾�¿bñ,½ À6ÂXÁiÃ�¾ð(¾�È ÝoâqÈ Ã�¾�¿)½ ¾�ÀVÉMÎ�¿�Ã�Ê

º�¹ Ø�¹ º�Ð�Â�Ãoå�Æ�Ã"ê�æ�Å�ÁZÆ�Ç$Å�Á8½ Î"¾,ê�ÒqÅ�È Æ�Ã"ê7Å"¾�¿_Ù;Î�È Î�Ç�ânÈ Ã"¾�¿)½ ¾�ÀVÉMÎ,¿�Ã>Ê

º�¹ ò;ðS×"Å,Ô"½ Á2ÝdÅ�¾�¿1ÐfÇ$Å"¾�Ê>×"Å"Ç&Ã�¾�Ô�Ý

º�¹ ólÚ�Ç$Å,Ô�Á8½ Ô,Å�ÈXàxÊ7Ã>ÊMÎ�ë�ânÈ Ã"¾�¿6½ ¾�ÀVÉMÎ�¿�Ã>Ê

º�¹ ó�¹$Ì~Ù;Î�È Î�ÇZ½ ô�Å�Á8½ Î�¾

º�¹ ó�¹ Ñ�ãfÃ,Å�È ½ Ê~Á8½ ÔLæ6Â�Å>¿�Î�ÏvÊ(Å"¾�¿�å�½ ÀfÂ�È ½ À6Â7Á$Ê

º�¹ õ^Ù�Î�ÖLÖ(Î"¾1Ú�Ç2Î�Û�È Ã�ÖMÊ(Å"¾�¿�¼>Ç&Ã>Ü6Æ�Ã�¾7Á8È Ý:Þ;Ê>Ë�Ã,¿@ß(Æ�Ã>Ê~Á8½ Î�¾�Ê

à�¾�½ Á"Ø_á Ð"Î�Æ�Ô"Â,Æ,×1Å"¾�¿Vö"¾,Â�Å�¾�Ô,Ã"ÖSÃ"¾7Á

Ø�¹$Ìx÷uÖL×�Ç$Î�ç�½ ¾�À1Ð�Î�¾�Å"È7ã6Å�¾�À�Ã

Ø�¹$Ì�¹$Ì�å�½ ÀfÂ�È ½ À6Â7Á$Ê(Å"¾�¿_æ6Â�Å>¿�Î�ÏvÊ

Ø�¹$Ì�¹ Ñ�ànÊ>½ ¾�À1ÁZÂ�ÃKñ�Ã�ç�Ã"È ÊlÐ�Î,Î�È

Ø�¹ Ñlã6Ã�Ö(Î�ç�½ ¾�À_Ù�Î�È Î�Ç"Ù�Å�Ê~Á$Ê

Ø�¹ Ñ�¹$ÌNÐ�Â�ÃLÙvÆ,Ç.ç�Ã>ÊQÐ"Î>Î�È

Ø�¹ Ñ�¹ Ñ,Ù;Î�È Î�Ç"Ù;Î�ÇZÇ&Ã,Ô�ÁA½ ¾�À�Û>Ýoâ6Å"È Å�¾�Ô�½ ¾�À1Á8Â�ÃKÄ^Ã"Æ7Á8Ç$Å�È Ê

Ø�¹ Ñ�¹ »"¼>½ ¾�¿)½ ¾�À1ÁZÂ�ÃLæfÂ�Å,¿�Î�Ïdê,Éd½ ¿�Á&Î"¾�Ã�ê7Å"¾�¿�å�½ ÀfÂ�È ½ À6Â7Á

Ø�¹ Ñ�¹ ¸�ð�Á8Â�Ã�Ç"Ù�Î�È Î�Ç$ÊlÍVÃKéq¾�Î�Ï

Ø�¹ Ñ�¹ º�Ð�Â�ÃEÚ�Ã"Ç.ÁZÆ�ÇZÛ"Å�ÁA½ Î�¾MÐ"Ã,Ô"Â>¾�½ Ü6Æ�Ã

Ø�¹ Ñ�¹ Ø�äQÃ�Á.ÁA½ ¾�ÀVÉMÎ�Ç&ÃKÕxÃ�Á&Å�½ È7½ ¾7Á$ÎdÁZÂ�ÃLæ6Æ,Û7ø$Ã,Ô�Á

Ø�¹ Ñ�¹ ò,ð�Á8Â�Ã�Ç"Ù�Î�È Î�Ç"Ù�Î�Ç8Ç$Ã,Ô�ÁA½ ¾�À1Ð�Î,Î�È Ê

Ø�¹ Ñ�¹ ò�¹&ÌNÐ�Â�ÃLÙ�Î�È Î�Ç�â6Å�È Å"¾�Ô,ÃSÐ"Î>Î�È

Page 7: Grokking thegimp

ù�ú û�ú ü�ú û�ý�þ�ÿ������ �fþ����ÿ��� ���������������ý������ù�ú û�ú ü�ú ��ý�þ�ÿ�����ÿ� ���� ���!�"� ��� ��Mý!�����

ù�ú �$#6ÿ�%���� ��� ��&�'� ÿ�()� �þ�ÿ�+*,� �Zþ-�8þ�ÿ)�.� ���ÿSý!�����ù�ú /$�6þ�����%�ÿ�!� ��

ù�ú /6ú"0Ný�þ�ÿ21�3�þ�����%546���7+�8���9>ÿ�%��ù�ú /6ú û3:;�<� (=%>� � ?�� ÿ�@&A����CB � � � ����"� ��� D�ÿFE G���()%�� ÿù�ú /6ú ��:H#6ÿ�%>�$ÿ�7ÿ����� ��� D�ÿFE G���()%�� ÿ=��?�:+%�%>� I!� ��J�Zþ�ÿK1�3�þ ����%54-���7ù�ú /6ú />18 �þ ����%546���7ML�� �N?���� �

ù�ú OC:P�����ÿ)�!��� @�I

1�!� ��üFQ ����()%����� ��� ��ü�ú"08L��N��R$ÿ�93�'0�Q�S�� �þ,����T��� � @>�3I>Uü�ú û-L��N��R$ÿ�93�"û>Q=ý�þ!�N��� �6þ-�Zþ�ÿ2V3����7�� �5W,� ���ü�ú �ML��N��R$ÿ�93����Q�X^ÿ�Y��� � ��� ��Z�>� ���!�[ü�ú /,L��N��R$ÿ�93��/<Q=ý�þ�ÿ)����� �\� ?��Zþ�ÿF4(ÿ���(,��� @ü�ú OML��N��R$ÿ�93��O�Q�L!��3���"��(,��

ü�ú O�ú�0Y�������$ÿ�9 ��� ��5W:ÿ���(Sÿ ����� 92X�� Y�"���]��� ��3ü�ú O�ú û������ ���!���@&�'��� �6þ����ÿ��)46� ��9"þ!� �ü�ú O�ú �!��� ÿ��@<� ��ü�ú O�ú /�S�� ����ký�����9"þ�ÿ�

1�!� ��^FQ #6ÿ��@�ÿ���� ��1ý�ÿ�9"þ��� _`��ÿ�^�ú"0�ý�þ�ÿ2�'� 9�7�ÿ �`S�� � � ý������^�ú û�W,����@C� ÿ���`#6ÿ� @�ÿ���� ��1ý�ÿ�9"þ��� _<��ÿ�^�ú �qý�þ�ÿKE�()A!���6�!�@a�'�!()%b(6��%2S�� � �iÿ��"^�ú /$�6þ���@�� *.^�ú O$#6ÿ��@�ÿ���� ��aL��N��R$ÿ�93�CB]Q�X$�N��%K�6þ ��@��3*c���@aL����9�þ �����^�ú ùd#6ÿ��@�ÿ���� ��aL��N��R$ÿ�93�CBeBeQ\:P�����]D�ÿ�@b�!�iÿ!�9�� �^�ú ü$#6ÿ��@�ÿ���� ��aL��N��R$ÿ�93�CBeBNB]Q3�vþ�� �ÿ�� ÿ�@1ý�ÿ3G��

1�!� ��fFQ gVÿ�A! ���ÿ������� 9�W=B]4)Lf�ú"0�gVÿ�AZ:d!� (,�3��� ��

f�ú"0�ú"031��� ��5W=B S)S�� � ÿ�.?"��� :d!� (,�3��� ��f�ú"0�ú û!WZBe4)LFV3� I�ÿ��"-�$����6ÿ�þ�� D�ÿ2V�� 7=ÿ6:$!� (,� ��� ���S��"��(Sÿ�f�ú"0�ú ����� D�� ��:d!� (,� ��� ��3.���KWZB]Sf�ú"0�ú /�:;��ÿ�9����@aE G���()%>� ÿ=� ?��.�$ÿ�� ��� ��b��W=B S.:d�� (,�3��� ��f�ú"0�ú O�:$!� (,� ��� ��=h,%���� ()� i��3��� ��

Page 8: Grokking thegimp

j�k"l�k m>n oap�q�rj�k s>k t+u v w�xYp�y�u zbn {,p�|>zF}6p�r�~j�k ��k ���!r!zF���e�[z�w �"~j�k �<k �>v u z�p�y>u z2�<p�w�xY|<q"��������~j�k ��k oaz�y!���>p ��z)t���u ��q

j�k ��k"l����!r!z�~-����t���u ��q��$v ~��"��q]��v ���j�k ��k s���� �.��t���u ��q����3~���z�{6~6p!����oaz�yb�'q"�3�.~3z�q!t���u ��q>�!p�u z3�N��z�~j�k ��k ��t8����� z�q]��v � |2�"�5n ���>z���z��bt���u ��qj�k ��k ��o�� p �Cn ~.����z2�<z�~���t+� ��v w�z��

j�k m>k ��z�{)v ���`q"p�� ~�r�p�q"z�� w �Zp!����n ���>z���z���n {,p�|�z�~j�k ��k o���v w����3��q�{,p3���=n �6��q����>�!�.�

���!v �'l��F� �=n]})�F <z�~����!q"w�z�~

���!v �'l�lZ��¡<z ��y!��p�q"�b�<� ��q]��w����"~

��v y>u v �!|Cq"p�r����n � �>z3�

Page 9: Grokking thegimp

¢¤£¦¥2§�¨!©[ªH«F¬®­¯£&¬!©�°K±³²H´5µ·¶¸¥¹±¦´»ºJ¼¾½�¿À©�°2²&¬!©�£¦´»Á�©�°2±¦´bÂF±

Ã�Ä<ŠƹÇ<ÈÊÉ`Ë'ÌÀÅ ÍdÄ�Î8Ï�È>ÎÐÅ ÇCÑ�ÇCÈTÏ�Ç<ÑÊÌÀÏ�ÆFÎÐÄ�ѾÈÊÏ<Ò Å]Ï�ÑaÓ>ÑTÌ�Æ<Å ÈÊϹÈ>ÔÖÕ

×¹Ø�Ù8ÚCÚCÛNÜ8ÝJÞ[ß+àá×�â�ãåäæCçJè&é.êÐëÊç®ìKí�î$ï�ðñóòdô�ô$ô æCç®õ5ë�öø÷¹ù ú$ë.êÀðáûKí�æ$üNù ðÊý$ùNî�þ6ÿ8öaöaö���îTëTö¦ê ù údë.êÀð�� ������5ì2õ ô��� ����� �� ô��8ò������ �

Ã�Ä<Å Æ ��È<È�� Å Æ �+Å Æ!ÎÀÌÀÅ ����Î�Ñ�� �'Ï���ÑTÌ ÎÀÄ�Ñ �����! "�#%$�&('*)�+-,*'/.! 01'/)��1 �2%� Í��'Å �8ÑÊÒ Å]Ï�Ñ<Æ ��Ñ`Æ�ÇTÌÀÅ(�'Ñ3� 4`ÎÄ�Î[ÎÀÉdÕ 565879797;: ÈÊÉ'ÑTÏ�Ç<ÈÊÏ�Î�ÑTÏ�Î<: ÈÊÌ�Í :�Ã�Ä�ÑaÔ�ÈÊÒ Ò È%7&Å Ï>Í Å ÆbÎÀÄ�Ñ�Î�Ñ%=�Î'È>ÔCÎÀÄ�Ñ¦Ò Å ÇCÑTÏ�Æ�Ñ>4<Æ�Å Î-4TÉ8É�Ò Å Ñ<ÆbÎ�È�ÎÀÄCÅ Æ?7FÈTÌ@��Õ

A8B�C9D�E;FGAHCGDJIKD�LNM�OQPRLTSUP?MNVTFWL9IRPRXGA6Y�AHDNX[ZGLGX\IRP;XGAHY�AHDNX[]^D�C�O9A(PRL_O

Ã�Ä<Å ÆT�'È<È��a`@`cbaÌ�È��d��Å Ï>Í ÎÀÄ�ÑebKfgKhji(iGkl4>Ëe�'Ñ Ì�ÑÊÉ8Ì�È��U��ÇCÑ��m4TÏ%�n�+Å Æ!ÎÀÌÀÅ(����Î�Ñ��¸Å Ïo7&Ä�ÈÊÒ Ñ ÈTÌ¾Å Ï É-4TÌ[Îqp¹Å]Ïa4TÏ!Ëk&Ñ3�+Å �rk É8Ä!Ë�Æ<Å Ç34TÒTÈÊÌZÑÊÒ Ñ<Ç`ÎÀÌ�ÈÊÏ<Å Ç�p6É�Ì�È�Ó'Å �8Ñ3� ÎÀÄ%4>Î=ÎÀÄ�Ñ Î�ÑTÌ@k¹ÆHÈ�Ô=ÎÀÄCÅ ÆJÒ Å ÇCÑTÏ�Æ�Ñs4ÊÌ�Ñs43�+Ä�ÑTÌ�Ñ3�áÎ�È�pU4ÊÏ�� ÎÀÄ%4>ÎMÎÀÄCÅ ÆÒ]Å ÇCÑTÏ�Æ�ѾÈÊÌr4TϾŠÏ�ÇCÈTÌÀÉ'ÈÊÌt4`ÎÀÅ ÈÊϹÈ>Ô$Å Î��<ËóÌ�Ñ�Ô�ÑÊÌ�ÑÊÏ�ÇCÑPÅ Æl�+Å Æ<É8Ò 4>Ë>Ñ��åÅ Ï5ÎÀÄ�ÑPÌ�ÑÊÉ8Ì�È3���>Ç>ÎÀÅ ÈTÏ-:

h8Ì�ÈTÉ�ÑTÌ`Ô ÈTÌ@k Ô�ÈÊÌr4ÊϾŠÏ�Ç<ÈÊÌÀÉ'ÈTÌu4>ÎÀÅ ÈTÏK�`ËóÌ�Ñ>Ô�ÑÊÌ�ÑTÏ�Ç<ѦŠÆl4<ÆFÔ�ÈTÒ]Ò È�7FÆCÕv ÈTÉ<ËCÌÀÅ Í+Ä!Î�w�Ç3xUy-z�z3z|{-Ñ%7m}.Å ��ÑTÌ�Æ~h��3�8Ò]Å Æ<Ä<Å Ï>ÍJ:óÃ�Ä<Å Æ>k�4`Î�ÑTÌÀÅ 4TÒ1k�4>Ë~��Ñ��+Å Æ!ÎÀÌÀÅ ����Î�Ñ�� ÈÊÏ<Ò Ë�Æ!�r�d��Ñ<Ç`ÎÊÎ�ÈóÎÀÄ�Ñ

Î�ÑTÌ@k¹Æl4TÏ%�HÇCÈTÏ%�+Å ÎÀÅ ÈÊÏ�Æ5Æ�Ñ>Î<Ô�ÈÊÌ[ÎÀľŠÏ5ÎÀÄ�ÑK�aÉ�ÑTÏ�hj�r�8Ò Å Ç�4`ÎÀÅ ÈÊÏ��`Å ÇCÑÊÏ�Æ�Ñ�p�Ój��:(z�ÈTÌ�Ò 4`Î�ÑTÌ�w�ÎÀÄ�ÑPÒ 4>Î�Ñ<Æ!Î`Ó>ÑTÌ�Æ<Å ÈÊÏ�Å ÆÉ�Ì�Ñ`Æ�ÑTÏ�ÎÀÒ Ë�4>Ó%4ÊÅ Ò 4j��Ò ÑK4>Î�Ä!Î[ÎÐÉ$Õ 585679797;: ÈÊÉ'ÑÊÏ�ÇCÈTÏ�Î�ÑÊÏ!Î<:]ÈTÌ�Ír5 ÈTÉ�ÑTÏCÉ��r�!5�x�:

Ã�Ä�ѦÌ�Ñ>Ô�ÑÊÌ�ÑTÏ�Ç<Ñ�k>��Æ!Î���ÑPÅ(k>k&Ñ3�+Å 4`Î�ÑÊÒ Ë5Ô�ÈÊÒ Ò È%7FÑ���7&Å ÎÀÄ5ÎÐÄ�ѾÑTÒ Ñ<Ç`Î�Ñ3�HÈÊÉ<ÎÀÅ ÈTÏ�Æ;w�Æ�ÑCÑ�Æ�ÑCÇ>ÎÀÅ ÈTÏ��Wf x�:

v È�kKk¹ÑÊÌ�ÇTÅ 4TÒ�Ì�Ñ��.Å Æ!ÎÀÌÀÅ ����ÎÀÅ ÈTÏ&È>Ôj�aÉ'ÑÊÏ�hj�3��Ò Å Ç34>ÎÐÅ ÈÊÏ�� Ò Å Ç<ÑÊÏ�Æ�Ñ���k�4>Î�ÑÊÌÀÅ 4ÊÒ!Å Æ�É'ÑÊÌ@k�Å Î[Î�Ñ3��:

A8A6B-�WP;�j�?CGA*�RV�MÃ�Ä�ѾÇCÈTÉ<ËCÌÀÅ ÍdÄ!Î�ŠƹÈ%7&Ï�Ñ3�|�<Ë�{-Ñ�7�}MÅ �8ÑÊÌ�ÆKhj�r�8Ò Å Æ`ÄCÅ Ï>ÍJ:

A8A6A6BrO��WP;��D�P;Y��-A*�?D�L_O�Dg¹ÑÊÌ�Ñ[4'Í8ÍdÌ�Ñ'Í�4`ÎÀÅ ÈÊÏåÈ�Ô=ÎÀÄCÅ Æ�7FÈTÌ@�cÈÊÌ�4 É'ÈÊÌ[ÎÀÅ ÈÊÏ È>ÔZÎÐÄ<Å Æ�7FÈÊÌ@��7&Å ÎÀÄ È`ÎÀÄ�ÑTÌN7FÈTÌ@� Æ ÈÊÌKÉ8Ì�È'ÍdÌt4�k5Æ ÈTÏ ÎÐÄ�ÑJÆ�4�k¹Ñk&Ñ3�+Å 4 Æ<Ä�4ÊÒ ÒTÏ�È`ÎdÇ34-��Æ�Ñ ÎÀÄCÅ ÆHÒ]Å Ç<ÑÊÏ�Æ�ÑHÎ�È�4TÉ8É�Ò ËPÎ�ÈPÎÀÄ�È`Æ�Ñ È>ÎÀÄ�ÑTÌ�7FÈTÌ@� Æ3:<Ã�Ä�Ñ�4CÍ8Í+Ì�ÑCÍ�4>Î�Ñ�7FÈTÌ@�aÆ`Ä%4TÒ]Ò�Ç<ÈÊÏ!Îu4TÅ]Ï�4Ï�È>ÎÐÅ ÇCÑ�Æ<É'ÑCÇTÅ Ô[ËCÅ]Ï�ÍPÎÀÄ�ѦŠÏ�ÇÊÒ ��Æ`Å ÈTÏ&È>ÔCÎÀÄ�Ñ��&É�ÑTÏ�hj�r�8Ò]Å Ç�4`ÎÀÅ ÈTÏKk�4>Î�ÑÊÌÀÅ 4ÊÒ�4ÊÏ���4ÊÉ8É8Ì�ÈÊÉ8ÌÀÅ 4`Î�ѾÇCÈTÉ`Ë'ÌÀÅ Í+Ä!Î�Ï�È`ÎÀÅ ÇCÑ�:

Page 10: Grokking thegimp

�W�j�^���J�G��� -� ¡j¢�£K¤ ¥�¦j§d¨n©r¦�ª6«�¬%¥�«@­3® ¯±°(® ²�³�§�¯�³n® ¯a¥u¬j´3§%µ¶«t¬¸·-³n´r§�³�§¹¥�¬jªt²3³�¦�·�° ³¸® §T¦�§¹¨Qº@´3ª@® ¯�µU® ²!«@® ¬j§r»G«@­%³ªt³�¼�¦j® §3® §!½�©-¬jª6«q® ¬j§�¯l¬%¥r«@­%³¾°(® ²3³j§�¯�³�ªt³�¼l¦�® §K® §¿¥u¬�ªt²�³�À

Á_ÂÄà �^�9�U� Á ¡�¢?£UÅR©r³j§�Æj´3·�° ® ²3¦!«q® ¬�§�Ç�¬jª@È�¯~¦�ªt³É° ® ²3³j§�¯�³3µQ¦j§%µÊ©�ªt¬!Ë3® µ�³3µÍÌ8¦1¯s® ¯�Ì�Ç�® «@­�¬j´�«JÇ�¦jª@ªt¦�§d«6¨�¬%¥�¦j§d¨È�® §%µJ»U³�Î-©�ªt³�¯d¯|¬�ª9® ¼K©�° ® ³�µJ»�®(§�²�° ´%µJ® §!½U»�·�´�«^§�¬1«^°(® ¼>® «t³3µÉ«t¬�»�«@­%³o® ¼K©�°(® ³�µÉÇ�¦jª@ªt¦�§�«@® ³�¯�¬%¥^¼�³�ªt²j­%¦j§�«t¦�·�® ° ® «H¨s¦j§%µ¥<® «@§%³1¯�¯�¥u¬�ªr¦�©r¦�ª6«@® ²j´3° ¦jª�©�´3ª@©-¬1¯�³>¬�ªr¦�Ç�¦�ª@ªt¦j§�«H¨R¬!¥�§%¬j§�ÏЮ §d¥qª@® §!½�³�¼l³�§d«ÑÀ

� �?£��9��ÒRÓG�6�9�JÔ�� Á ¡�� Â�Á Ô Â;Õ �HÖ��H� ÕÉÃo �W×��Ø ° °�¼�¬�µU® ¥q® ³3µÄË%³�ª8¯�® ¬j§�¯e¬!¥~µ�¬�²j´3¼�³j§�«8¯n²�¬!Ë%³�ªt³�µÙ·�¨�«@­3® ¯Ú° ® ²3³j§�¯�³�»�®(§�²�° ´!µU® §!½Ä«@ªu¦j§�¯1° ¦1«@® ¬j§�¯�»;¦�§d«@­%¬j° ¬3½U® ³1¯3»²3¬j¼K©�®(° ¦1«@® ¬�§�¯l¦�§�µ�©r¦�ª6«@® ¦�°�µ�¬�²j´3¼�³j§�«8¯3»1¼>´�¯d«�¼l³3³!«3«@­%³�¥�¬j°(° ¬�Ç�®(§%½|ªt³�ÛU´3®(ªt³j¼�³j§�«8¯rÜ

ÝdÞjß ­�³�¼�¬�µJ® ¥q® ³3µ¾Ë%³�ª8¯1® ¬j§K¼>´�¯d«�·-³¾° ¦j·-³j° ³3µ�¦1¯à¯!´!²�­rÀ

árÞjß ­�³�©r³�ª8¯�¬j§K¼�¦jÈ�® §!½�«@­%³�¼l¬3µU® ¥<® ²3¦!«@® ¬j§�¯>¼;´%¯¹«�·r³�® µ�³j§�«@® ¥<® ³�µ�¦�§�µ�«@­�³�¼�¬�µJ® ¥q® ²�¦1«@® ¬�§�¯lµ�¦!«t³3µ�À

â3Þ�Ø ²�Èd§%¬�ÇR° ³�µ�½�³�¼l³�§d«�¬!¥�«q­�³�¬�ª@® ½U® §�¦�°!¦j´�«@­%¬jª�¦j§%µÉ©�´r·�° ® ¯1­%³jª�® ¥J¦j©�©�° ® ²3¦j·�° ³�¼>´�¯d«N·r³�ªt³1«t¦�® §%³�µÍ¦�²3²�¬�ªtµU®(§%½�«u¬§%¬jªq¼l¦�°�¦3²�¦3µ�³�¼>® ²>²�® «u¦!«@® ¬j§K©�ªt¦3²!«q® ²3³1¯rÀ

ãjÞjß ­�³�° ¬3²�¦1«@® ¬j§�¬%¥r«@­%³K¬jª@® ½U® §%¦j°d´3§3¼l¬3µU® ¥q® ³3µ~µ�¬�²j´3¼�³j§�«�¼>´%¯¹«�·r³�® µ�³�§�«@® ¥q® ³�µNÀ

ä ÞKß ­�³�¬jª@® ½�® §%¦j°W¦j´�«q­�¬�ªcå ¯æ§%¦j¼�³n¼�¦%¨æ§%¬!«¾·r³m´�¯�³�µ±«t¬e¦1¯�¯�³�ª6«;¬jª�®(¼>©�° ¨T³j§%µ�¬�ª8¯�³�¼l³�§d«;¬!¥;«@­%³nªt³1¯1´3° «@® §!½µ�¬�²j´3¼�³j§�«1Ç�® «@­%¬-´�«�«q­�³K¬jª@® ½�® §%¦j°ç¦j´�«@­%¬jª@å ¯;èu¬jª-¦-´�«@­�¬�ª8¯1å Þ ©-³jª@¼K® ¯�¯1® ¬j§-À

��£-é ÂàÂRÕ�êÐë �U�Wì_¡��*ì?�Q�9�Uì  ÔKÔ�� ÁGÕ ��¡�� ÂRÁ �¤§Í¦�µ�µU® «q® ¬j§�«u¬í«@­�³\ªt³3Û�´3®(ªt³j¼�³�§d«8¯Í¬!¥?«@­3® ¯É°(® ²�³�§�¯�³�»^® «�® ¯îªt³3Û�´%³�¯d«t³�µÊ¥qªt¬�¼ï¦�§�µÊ¯d«@ªt¬�§%½�° ¨íªt³�²3¬j¼K¼�³j§%µ�³�µ�¬%¥ªt³3µU® ¯¹«@ªq® ·�´�«t¬jªt¯�«q­�¦1«<Ü

ÝdÞ ¤ ¥K¨!¬-´m¦jªt³ÚµJ® ¯d«@ª@® ·�´�«@®(§%½ðÅR©-³j§ÚÆ�´3·�° ® ²3¦!«q® ¬j§�Ç�¬jª@È�¯±¬�§m­�¦�ªtµ�²3¬j©1¨m¬�ª�ñ�ò�Ï�ó�Å;ôK»l¨!¬-´¸©�ªt¬!Ë3® µ�³¶³j¼�¦j®(°§%¬!«q® ¥q® ²�¦1«@® ¬�§K«t¬�«@­�³~¦-´�«@­�¬�ª8¯>¬%¥�¨!¬j´3ªU® §�«t³�§d«�«t¬sªt³�µJ® ¯¹«qª@® ·�´�«t³~¦1«�° ³3¦1¯d«�«@­3® ª6«6¨�µ�¦!¨�¯�·r³!¥u¬jªu³>¨%¬j´3ª_¼�¦j§�´�¯�²�ª@® ©�« ¬�ª¼�³3µU® ¦m¥qªt³�³1õ%³�»à«t¬ö½U® Ë!³±«@­�³¸¦j´�«q­�¬�ª8¯æ«@®(¼l³±«u¬ð©�ªt¬!Ë3® µ�³¶´r©rµ�¦1«t³3µ÷µ�¬3²-´r¼�³j§�«8¯3À ß ­�® ¯¸§%¬!«q® ¥q® ²3¦!«q® ¬�§æ¯�­�¬j´3° µµ�³1¯�²jª@®(·r³�¼l¬3µU® ¥q® ²3¦!«q® ¬j§�¯3»1® ¥j¦j§d¨-»1¼�¦�µ�³R«u¬R«q­�³Kµ�¬3²-´r¼�³j§�«<À

Page 11: Grokking thegimp

ørùJú?û û1ü1ýrþ3ü¹ÿ�����ÿ�� ������ �� ��� ���1ÿ�� ����ü���������û ý� �� ���� ��jû �!ÿ�� ����ü�ù^þ������ ÿ����� !��û ���� @û "#��� �$%�� Qý'&����~ÿ����# (���jý������ÿ��� ��û ü��) ��1ü��� �� þ'�� #���������!ÿ8ÿ*����������dÿ3ÿ*�;ÿ����+ (���jý������ÿ-,

.�� ���jû(û "�/�0����(û �1� ÿ2� ü3���!ÿ24���� (�!ÿ��� 5"�ý��� ��� �ÿ���� ü~û � ������ü���/�� ÿ6� ü)������ü�� ��� *�� 7������ 1���� �mÿ*�����8�9�� ��:�- *��������&;"<������=">���� * (����&;"?���� A@CB!DFEHGJIK��L�&� *��üdü�� �����������?G?&'���>Mjý3þ�û � ���!ÿ�� ����DÐû � ������ü��� :0C�� �$Wÿ��N� ÿ8ü4�jý�ÿ����� -,

OCP8Q�R�S'RUTWVXR!Y[ZJ\�VXP]Z?^W_

`dùJBa� üdÿ� �� þ�ý�ÿ�� ���7���Wü1ý3þ3üdÿ*���dÿ�� ���jû "b��� �� ��� �� [���� 8ü�� ����ü����Gÿ���� ü7 ����-ý'�����ÿc� üd&� *�����(þ�� ÿ*�� b0�� ÿ����-ý�ÿWÿ����e��L�&�û � ��� ÿ&��� �)� ü�ü;� �������3ÿ����)����&;"' �� �U��ÿ����jû ��� -,

ørùfBa� üdÿ� �� þ�ý�ÿ�� ��������ÿ����g0C�� �$)�� a ��� �� ���1ÿ�� ���1����ÿ����g0C�� �$N� �g���h"�ü¹ÿ����� ��� * i��&'��&'�� tùàþ�����$?���� �j� ü1&( *����� þ�� ÿ*�� ý'��û �1ü�ü1&� �� �� f&'�� �+� ü�ü�� ���1� üg��þ�ÿ*��� ���� ��� *��Äÿ���������&;"' �� ���dÿk���jû ��� -,lG?ÿ����� !���� �àüg���6 �� üdÿ� �� þ�ý�ÿ�� ���m� ����û ý� �� ���@CBXDFEHGJI+/��jû ���1ÿ� *����� ��/����� #��������1ÿ�� �N��� �� �)�� *�N&'�� �)� ÿ6ÿ*�� !,

Page 12: Grokking thegimp

n)o+o prqtsdu!vkwUxy z|{]}=~��A�*�g��~5}=�<���a���

� � � �����������'���U�%�F�J� � �r���������|������ ��F� ¡£¢]¤8¥4�� ¦¢�§��%¨��© ¡«ª ¬���� ¬­��®��(�����;�F¨'�;�F��¯° �;±]²5� ³�´ ¨ ³�µ��´ ��§*¶ �a·a¸�¹tºc»5�¼ ½ ¨�¾�²8¿���À«¶ ��Á¢�� ¶ ��§%Ãa®�Ä�À���Å«¶ ��§ÆÇ Áh�È¢����´ �hÁ�¨ ����� ³�´ ��µ ¡��F���������- �Á����HÉ%�©��H� ¶ �|Á|�'� ¡��=Ê��2Ër�hÁ|�'� ¡��hÊ�¶ �|Á��������� �Á%���HÉ£ÌÍÄ��;�ÂÅ Î�������Å ¬���É��hÁ¢]²5�(�£�����r�'�F��®��(���%���F¨Ï�%Å��W¯ УÁ��Ȳѵ ¬ ´ �±* t¢ ¬�ÒÓ� ³�´ ª��|Ì�¨Í¶ Æ ©F����Å«¶ ��§ ÆÇ Á��³;�=�F�����'���´ ��Ã

Ô�Õ*ÔÂÖ¦×-Ø-Ù(Ú|Û Ù�Ü�Ý(Ù�Þ�ß�à�Ü�Ù'×âá�ãWä%å�æUç6ä�ã è'çtéUê!ç!ÜAëJìÑí>î

ï ¶ �������´ �(¢=ÁÂÊ ð«�hÁ ï Å-¶ �%§ ÆÇ Á=¢È¤8¥?±�¨��5¬�ʼ ®FÄ�À;��§�¨�Ër�hÁ|�'� ð��=Ê-¶ ��Á ï �Â�«�- �Á%���ñ�%Å;��Ì�Är�;�ÂÅ Î�� ï Ê-¶ ��Á�æ� ³�´ ¢]¤8¥�ª���¾��'�F�ò·a¸�¹tºa�'� ð��=Ê-¶ ��Áï �����- �Á����N�%Å;�|ÌÍÄ��;��Å Î�� ï � ��Å-¶ ��� ³ �U�|��¶ Á�ÌÍÄ ð�� � �r��ó¦�(�£��� ô��?�� 2��� ð���� ³�´ �=Ê ï Ê-¶ ��Á ï ¬­��Ì«�NÄ ¬�Á�� ³ �

õrö8õrö÷õ�ø6ù�ú�û�üWý2þWÿ�������� ���û��ù�� � ���������������������� ���!#"%$ &�'���(*)

ô���¾%+-,.+�»0/¿���±�Ä=ÁÂÊ ¬�§%��À«¶ ��Á|Ë��=Á���� ð��=Ê-¶ ��Ár�È¢����´ �=Á%¨ ���c�'� ð��=Ê-¶ ��Á|� ³ ��ª����(�F� ï�1 ��¤ ï ¢�� ¬�9Á|� ³�´ ¢]¤8¥:� �° Ä=��µ ð�®��H�|� ï �F¨+·a¸�¹tºa��� ð��Ê-¶ ��Á������'� ³ ���(�£��ª]¤]Ì�§ ð£Ä ð«§�À��ѤÑ� ï �F¥�²32�4Wµ�� ¼ ÄÓ��§Â¨��Ȭ�9Á¦� ¨�� ©-Ì«¯�Å]²�»6587 9 :¿��%Å;�<;�=�>@?ÂÉ%±³r®�¯U� ² ï �F��§��*²�»65BADC0:8E�C.AF8>-G�¿�Éh�|� Î%¢ ï �F��§%�*²»IH�/KJDL�EMCNADF8>@G�¿�É|¾]© ¶ ï ¬­�>»6HOCPF@?-Q�¿�É�Å�§hÄ�Å��%À4»9º8/@=R=P:C�>�¿��%Å�� ï ���-ÌFÅ-¶ ±³�»÷·SC0/KGM7 :>T=Ñ¿8� ³�´ ¢È¤8¥ ï  6Å ¬�Á���µ ð�Á���� »÷±÷ X��� ¬­�(�F�%À;Å���� �³;À�ÄrËr�hÁ��ѤÑ� ï �F¥�²�=Ê-¶ Å���µ�� ¼ Ä�ª�� ï Å-¶ ��§KUÇ Á����'���(Ê�¶ ��Ã�Ì���¿

�È¢����´ �hÁ�¨ ����� ï�������9¤ ï ��À-¶ �|Á|���'��� ð��=Ê-¶ ��Ár�È¢����´ �hÁ%¨ ���������'� ³ ��ª���¨ ³'Ê ¬�§���Å��� ïV ¶ ���'��À © ¶�¢È¤8¥4ª��±��%¨'���WU�� �° Ä�Ä ©-ÌÍÄ ð�®�Ä�Àh��µ ð�� ¨ ð���±È²9Ä ¬­��� � ¼ �«Å¢�ż ½ ï � ³�´ �©���Ër�hÁh�È¢����´ �hÁ�¨ ����� ³�´ ¢È¤8¥)Ê ð«�hÁ ï ���!¢È¤8¥4ª���¾���§�¶ �%¨ ³��'� ð��hÊ�¶ �|Á�À«¶ ��À��%±�ÄÂÁ=Ê ¬�§���Å��� ï Ër�hÁh�È¢����´ �hÁ�¨ ���r�Ȭ����Ã=�(�F� ï1 ËÇ ����¨��X�'� ð��hÊ-¶ ��Á�À«¶ ��Àr� ³ ��ª��� �° Ä�¢ ð���Á�Ì�§ ð£Ê�Å���Ä'�%Å;�%ª���� �(ų�´ À����F�%À;Å���� �³;À�ÄrË��=Á=Ê ¬�§���Å��� ï Ì«�UÊ��%¨(�È¢����´ �hÁ�¨ ����� ³�´ � �(ų�´ Àr��Ì«�'®FÄ�À�� ¬�Ê=®���¨]¬�ʼ � ¾ ��´ �rµ«¶ §�Àh�F� ð£¢È¤8¥4�� �Á%����±;�hÄ�§ ï

Page 13: Grokking thegimp

XOY@ZD[\ ]�^`_Ka�b c d Y8eNfPgihjX b a dlk�m Z�Y-n�ojp d�m Y ^qkr ZiZ sTt�Y@XqYKn c t u v mTwx<y h y d�z u ^Mz r3^Ok Z�{DY@Z ^ r ] eNfPg|t�Y@XqYKn cq} nr�~ Z y � a u�� }����k Z�h y d�� y ~|}����k Z } X ^ ���8� � ���� � �D� �����%�i��8�D�����-�I� �D�B� {DY@ZD� ^ d Y a�b Y m} e�n� v k8m X ��k�� y ~�a n m ��n��k t u v m {DY-Z�er�~N�0��k n � y�y d � ~ e���t u v m��M� �6 6� �¢¡ �M£�¤ � ¥R�P�|¡i� z r v ¦§YT¨ z r v-©-ª.©B«6¬�­_ t y mKa u�� k�~lb Y m [ k8m � ^ d Y a�b Y m@~�b k�~Dz r v } w ®^§a u�� }����k ZD[ k�m�} e�n� v k�m X ��k h ��b tr

¯R°±° Z�Y-n�ojp d e���t u v m {DY@ZMer�~R�0��k n � y eNfPg a dlk8m_�^�b oW{� b Y ��w n _ Z�nWXqZ6� � u m�z � m Y ^Ok�~ � b ��^ � ^ d Y a�b Y mTz r v eNfPg a dlk8m Z�YKn � y ~ t u m} Z a � b Y-Z�n kD� [ k�m� ^ d Y a�b Y m {�²-X r tr�} [ d X#��n��k eNfPg k YB{{�²�e �³ ´ Z z r v Z�n kD� [ k�m � ^ d Y a�b Y m} ¨ � v k eD�-Y@X _�^µb o�{ kr ZMe�n u]¶m Z sWh y d °�°

·¸P·¸ ¹�º�»�¼O½I¾�¿SÀ�Á�Â�Ã�Ä�Å ÃÆD¾ÇÃ�ÈÊÉ�Ë�Ì�ÍÏÎRÐÒÑ�Ó�ÍÕÔ×Ö Ø�Ù�Ú�ÛÝÜ

� ^ d Y a�b Y m ¦§YT¨ } w ®^ � ^ d Y a�b Y m�z r v t��Ýe u±Þ z r v tNf y [ k�m�ß�àRáãâ ¦�YT¨ z r v-©-ª äD« � ­ _ t y mKa u�� k�~lb Y m [ k�m � ^ d Y a�b Y m ¦�YT¨

oW� d t u m�} Z a � b Y z r v _BcD� y d Y ^q��^ [ k�m � ^ d Y ^§a�b Y m « ��� �6� � ¬ �D  ­�X r [ dlk eD�-Y@Xq� b Y�å ° � æ��8���Kç.è�� �-é��Bè ª ê-ë ¥.ç ©�ì�ª í «6î ß�ï ­�ä�íKí�ðiñ _ t y m [ dlk X � �q}�� s�Z^ dlk�~ [ k8m ¦�YT¨`Z �lb YB��e��k

òôó õöµ÷Wø@ù ú�û�üý�þ@ÿ ÷�� ÿ������ � ù ú � � �� ÿ ��ùöµ÷ � þ û � ��� ó � ý � � ó �ý � ó � � � û�ù�� ÿ � ó õ ��ÿ�� � õ û� �� �� û�� ÿ ø

Page 14: Grokking thegimp

�! "$#&%'(�*)$ +-,/.-)10 2(3-465 7 8:9<;=�> ?A@:?CBEDGFIHKJKL 9NM!9EO P(Q!RAP(S-T!U�VXWY�> B 5 Z []\ @ ^G? T _ H 5K`a T @:?CBcb Sed D P ^�f5KRg=�> ?CB MhTNS-Qji k�V L M ^ khg�Se\lPmO S b Sedn9 o p D ` ^�q _�Zf5 7 Ho > QA9Irc7 H&B ksV L M ^�D T]O 5 MfT =? 9hZ tu\ b Sednk o > ? Q _ O L 9!MN9EO P(Q<RAP(S(T!U�Vv` t B 9Ktp�9wUY:B

RAPxg�k�V$ZS(g�\*tu9Nk Y Zzy*{#-|-'x}�5 d =�> ? 5 Z []\~g t�Z:��S-Z/S(ge5 7 Ho > Q:9Irc7 HCB ` t B Z H O S�P D P ^�L 9!MN9]O P(Q!RAP(S-TNU�V�y�` _�g�S-Q H� 5 ?o�Q<`5�g=�> ?CB {#�|(' D ` ^ k o > MKt�P @ ^G?�� 0 �&}

�!� t�PA5 HA@w�E� 0 � r-�<` B P�O S:5 7 8:9!MN9 ^ S&�sO S BEb S�dnMfTfS-Qf5 H:@w�E� y�)$ +(,/.�)�+&�C"��C'A�K}hr H�� 5 7 8:9hT���TfT ?CBEb SednMhTNS-Qf5 H:@ �CyK|& '�)+x�C"��C'A�K}:��`/Q:kKt > P D 7�M!9 ^ S&�sO S BEb SedXrx�sO H�� \nS�9NU � T ojMhTNS-Qf5 H:@ 7~g � U�V ? Q _ O-r H�� � t�P/5 H:@ 9 o p�U � 5 d a > T @Y p�9!k���ZRg tp B k o > 5�g�S:5 7� `�yKMlg=? ��g^ S B }/MN9 ^ S&�sO S B�? tu9 L MfT]Ol���TNT��m�a P�O S q ^ Se7 �cU:U���\*tu9NM!9 ^ S&�sO S Bcb Sed @:?CB RK����5 7 8:9NMfTfS-QN5 HA@�]� r H ^ P�MN9 ^ SC�sO S BEb Sed ? tu9n�sO ?CD 7hk o > RK����5 7� `AU � 5 7 8:9NMfTfS-QN5 HA@w�c� 0�0 �c� 0�0 �c� 0�0 D 7�5�g=�> ? Q/ ¡U � Q/Zf5 P ^ 9hZ [-�sO ? 5 T =�> ?M!9 ^ S&�sO S BEb Sed ? tu9 L MhT�O 5 Za `AUAS-Z<R�V1� t > B�¢ '�)£|C '�)¤k o > RK��� L ; ^ 5 d =�> ?A@:? ` _ b SedX5K`a T L 9hT���TNT ?CB]L MfT]O¥ym` _g¦S(Q H�� 5 ?o�Q!`N5�g=�> ?&B�¢ '�)£|& 'e) D ` ^ k o > MKt�P @ ^G?�� 0 � 0 �&}N` t B 9�tp�9~� t�PA5 H:@ k o > U � 5 d a > T @Y p�9hZ [-R=? MhTNS-Qf5 H:@ 7~g � U�V$Tm��TT ?CBEb S�d§Q/Z!� t�P ? QsO S B 5 ;GO 9¨RK����5 7� `:MN9 ^ S&�sO S Bcb Sed ? Q _ O �/S-T!\nSe9 ? tu9!7©g � Z ? \ D 7I` ^ P(QAM!9 ^ S&�sO S BEb SednMhTNS-Q5 H:@w�E�ªC�c� r H��j�c� � t�P/5 H:@ k o > ? Q _ O \h9¬«� ­�® '¯�C#A�CU � 5 7 8:9 �]� 0 � ª:�E� 0 �°r H��j�c� 0 �±UAS-ZA9�tp�9¨RK����5 H=? Z L ; ^ R�V� t > B�¢ 'e)£|C '�)²Z tu\ b SednMhTNS-Qf5 H:@³�]� 5 d =�> ?A@:? ` _ b SedX5K`a T<9 o p L 9fTm��TNT ?CBEL MhT�O�MfTfS-Q<RAPxS-T!P�O SeMN9 ^ S&�sO S Be? tu9L MhT�O k o > 5 Za ` @Y p�9fU � � ^G?CB 5 7 8:9NMfTfS-Qf5 H:@w�E� 0 � 9Kt > 9©5 ?CB

�<ym´<µ$¶�} rc\h\~�o/k o > b Sed L ; ^G? Q _ O�UAS-Z!� t�P ? QsO S B MhTNS(Q qY:BEb Sed~9 o p�5 H=? Z L ; ^ �ohrc\h\·´!µ$¶¸g_�7�rc\h\~�o @:?CBEb S�d©Q t B �/S-TfS(g q5 7 8:9©rc\l\¨µ$��#-¹�º�3&#:® '»r H�¯¼ +-,'�2('&, ?o�Z<` ^ P(Qzym` _�g¦S(Q H�� 5 ?o�Q!`N5�g=�> ?&B g_�7�rc\h\~�o D ` ^ k o > MKt�P @ ^G?�� 0 ½:}

�/�C�&�¿¾ k�V L M ^ khg�Se\lPmO S�P�O S b Sed~k o > Z�V H t B r-�<` B�? Q _ O 9 o p D ` ^�q _�Z @ QS-QN5 7 8:9h� ?&B 5 k]O S-UAS-Z @ 9fS&`AU/ga B y � �&�&¾¯}9 ? Z/UAS-Z:9 o p~RK���³�/S-TfS(g q klg�Se\~g�S-Q H� 5 ?o�Q<` ?=�> 9f  D ` ^ UAS-ZAM!9 ^ S&�sO S B QsO ? Q:k o > r-�!` Bc@ ^G? T _ HA@:?CBEb S�d·y ¼ +e4�./��0]À� +-,/.-)�}A9Ktp�9N �` t B � t�P

? QGO S B k o >(� 0 �Ay��C}:�¦`/Q!R Ha Á Z @ P(Sek o > b Sed�5 H=? Z<R�V1� t > B� '�)Äà ¼ +e4�.0�À� +-,/.-)ÅMlg=? � t > B UAS-Z!Ro�Q J \ ? g J `<` ^ P(Q<R�V1� t > B1Æ!Ç ­m��® Ã³È Æ {<ÉC 4�­�ÃwÈ� ¦MN9 ^ S�sO S B QsO ? Q ? tu9!9 o p�9 o > 5 ?CB k o > U � \ ? Z qY:B ;A9 a ` @A?&Bcb Sed ªE@ 9fS&` @:?CBcb SedX5 7 8:9Nd a Zf5 W H y�Ê 2('A® ºe} ª RAP(S-T H�� 5 ?o�Q!` @:?CBEb S�dËy�´<'(ºe./® �e­� .A+�}s5 7 8:9NUK�m`/�o�sO ? 9 a p�P�y�,A.(­�º]Ìm +(3:É�}AMN9]O P(Q!RAP(S-TfQ/S�P @A?&BED T ^ \©g�g�kKt�`:k o > ? Q _ O ` ^ Se9 @ ^ S B r H�� ` ^ Se9!\h9 @:?CB MN9 ^ S&�sO S BEb S�d @:?CB RK���¬U � � t�T<d�tu9fÍ J Z tu\ @ 9hS&` @:?CBEb Sedk o > g � \�� D P ^�L 9 ¼ +e4�.0�À� +-,/.-)ÎR=? 5 7 8:9Nd a ZN5 W H 5 MfT =? 9fZ tu9w\h9 D T ^ \~g�g�k�t�`:kKtp B � ?CB ` ^ Se9N9 o p�U � T o H _�Z!ÏgG7©g¦S(ZCÐ ? Q _ O 5 d =�> ? r-�<` B ��VÑrcMN9]O B Z/S(g�ksV B Se9@A?&B RK���Òr H�(q ^ SeMfS-Z!RK����k~` HA?CBe@ Q tu\�5 T ^ S(� J \h9 b Sed @:?CB RK���ÓZ [EU � d~\lP�O S H _�Z!Ïg�\h9 D T ^ \~g�g�k�t�`:kKtp B � ?CB ` ^ Se9fU ��@ Q tu\¤�AS(T D 7I` ^ P(Q¯9 ? ZAUAS(Z:9 o pRK���wQ t B �/S-TfS(g q klg�Se\I��VÑrcMN9]O B Z/Sxg�k�V B Se9©5 7 8:9Irc\h\I� t�PA5 HA@xD ` ^ UAS-Zfr q \~� q Se9 � y*{:­*#-­��-º±�C#A�K}/WY�> B�? Q _ O ` ^ Se9 H O S B �K�m` @:?CB MN9 ^ SC�sO S BEb Sed£QZ� t�P ? QGO S B 5 ;�O 9 L 9 b Sednk o >(� 0 �Ay*#x}A\h9�{:­*#-­��-º±�:#:��r-�<` B PmO S-Z�V H t B ksV B S�9 ? Q _ O k o > ��VÑrcMN9EO B��&�/ª��cÔ �¯RK���³�/S-TfS(g q � t > B]L M ^ ��7~ger�Z�g�T D T]O � ^G?&B r-�<` BD T ^ \~g�g�k�t�`³r H� {:­*#-­��-º±�:#:� D ` ^ ��`/Q<R Ha Á Z @ P(S�k o > b Sed�5 H=? Z!R�V1� t > B� '�)Äð«:.C%/%!® '¯´N�C® ':��º¥Mhg=?¿Â '�)Äð«:.C%%<® '�{:­*#-­��-º±�:#:�

b Sednk o >(� 0 �Ay*3x}fr(�<` B�qY:B 5 T!9 _ER�V1� t > B ��VXMhg tu\ b S�d·y ¼ "$#x%'jÕ�':+x�-}/k o > g¦P�\~g¦P(TnRK���w�T<\*t��a d a 5KÏ:�Ör H� R�V1� t > B ��V¿R t�× L 9fZS(g¦U t�`/Z/Sxgb Sed D P ^ RK���w�/S(TNS(g q 5�go�Q/Z!` _ ¼ "$#&%/'jÕ�':+&� D ` ^ ` ^ P(Q/ZS(gER Ha Á Z @ P(Se\h9 b Sed¨Mhg=? R Ha Á ZA7��Ø*Tfg_�7 H _�Z<Ïg�k o > ? Q _ O Tm��T<\h9l�K�m`:kfS B ` ^ Se9NW ^ S-QT =?A@:?CBMN9 ^ S&�sO S BEb SedÙy�` _ D ` ^ U/S-Z b S�dnk o >(� 0 �Ay*#x}�}hr H� 5 T<9 _¦U � 7� ` ? t��&��9hT�t��a M H t B UAS-ZAk o > RK����R Ha Á ZN5 H=? Z<R�V1� t > B]L `A <r H ^ Pjrx�sO q ^ S�MfS-Z!RK����� ^G?CB Z/S(g¦U � 5 7� `5 T!9 _¥R ^ S B]D P ^ � H/? `�/S-TfS(g q ksV D ` ^ ��`/Q<R Ha Á ZAk o > 5�� ^ 9!7©g � ` ^ Se9N\h9l�K�m` @:?CBѼ "$#&%/'jÕ�':+x�¿` t Bcb Sednk o >(� 0 �Ay*,/}/Mhg=? 5 H=? ZA7� `&��`/Q<R Ha Á ZAk o > 5�� ^ 9!7©g �?o�Z!Rg tp B 5 T =�> ?CL `AZ [-�/S-T<k o > b Sed @:?CB RK���¬T o @ 9hS&` L Mh×IO ZAP�O SeMN9 ^ S&�sO S BEb Sed²RK���³�/S-TNSxg q 5 H=�> ? 9Ir q \�{3:��.A® ®c�:#:�&k o > ? Q _ O ` ^ Se9 @ P(S-T =? r H� ` ^ Se9 H O S BMN9 ^ S&�sO S B 5 d =�> ? ` _�k���Z�GO P�9 @A?CBEb Sed¨Mhg=?ÑL ; ^ 5 T ^ S(� J R Ha Á Z:W ^ S(Q<R ^ S BED P ^ k o > 7��Ø*Tfg_�7 H _�Z!Ïg��o > k a Ï:k o > ? Q _ O T���T H O S B ���m`:kfS B ` ^ Se9 @ P(S-T =? 5 d =�> ? 5�go�Q/Z!` _�km��Z��sO P�9@A?&Bcb Sed�` ^ PxQ¬ÚC#:+x+('A�-)$ +(,/.�)Ö` t BEb Sed~k o >(� 0 �Ay�'(} @ � � 5K`o�Q/P(Z tu965 T =�> ? RK���¬Q ^ S-QN5 T ^ S(� J k o > ? Q _ O \h96ÚC#:+x+('A�-)$ +(,/.�) b Sednk o > ? Q _ O L 9!MN9 ^ SC��O S Bb Sed©Z [EU ��@ Q tu\I�/S-T D 7I` ^ P(Q ?o�ZAPa Ío/k o > RK���zU � 5 H=? Z<` _�k���Z�GO P�9 @A?&Bcb Sed D ` ^G? QGO S B g¦P:`!5�g[EPCR=? Z/S(g L ; ^ 7��Ø*Tn�/g B Z H S Bc@:?CB 5 T ^ S(� J yKk o > T o<�S-T<7��Ø*TN}C��`/QR Ha Á Z³r H��@ Q tu\ D 7nTNS�\h9!MN9 ^ SC�sO S BEb Sed~9�t > 9I5 ?CB

��VXMlg tu\~� ?CB 7��Ø*Th�K�m`:k ^ S-Q:k o > ? Q _ O Tm��T H O S B ���m`�` ^ S�9!W ^ S-QT =? 9Ktp�9�To D P ^ 5 d =�> ?CL ; ^�L 9~R�V1� t > B1Û �C 3:Ü�Õ�#xº(Ü©WY�> B U � Z H O S�P qY:B]L 9!MKt�P @ ^G? k o > ½<0 Ô 0 �

ÝßÞ¦à�á â�ã�ä�Þ�å æmçGè àé�ê Þ�ã�à â�ëhìlí î�ï�ð�ñXî�òGó/ôGõ�ö�÷�ø�ùxúeí õuñXî�òsó/ô�õGö

Page 15: Grokking thegimp

û:ü�û:ü�ý:þ1ÿ�������������� �������� ������¥ÿ ����������� �"!�#�$&% ')(*%�(� +��,.-�� /�/�� 0 !�#�%� 1�32.4�56��7��89-�!�#

:<;>=<? @BADCDE F�GIHKJ�LDG�M�J�NDO3PQGSRDJ�TVUXW�PKO YZW3[�\ @ ]_^ ` a�\b^dc3ef A W�gih f WX? @BA h @�cXjD;ihk"lQc monph�;i[�k"lrq&e mtsvuxwzyQ{|cd}S~�k�;ih�;De���^ze@��3[ U ��TVU ����U���^zOf W�[�^ h \ ���� � �+����� H � ���X����� H�� �X�d� L>�)�DH*�K� �X� ��� {�H���� ��� ;i[�q�\ �B;���� ;Zg�^dc3ef A W�g�h f W qef W¡c3O¢ £ [�¤�jK;>? @BA q�\ �B;���� ;ZgZ:<;>=�NiO �¥j�^ Of W3[ �¦� H � �����§�� Hi� �X�d� L>�)�DH*��� �X� ��� {�Hi�"� � q&ef W�k m A g � ;i[ c@��d¨Is&W�e ¨9U U �¥jK� c"l.k m A g�©��� �"� ��ª�� NiO �¥jX^zOf W3[�^dc3ef A W�g�h f W�? @BA ^ qh�;DPKk�h

cd}S~pk�;Dh�;De��¬«­ [X®);De�;i��O3PX^ W@�� U�¤XW�gZTVUXW�PKO YZW3[ � H�� �X�d� TVU ��¯�\¬qdm�j�¤ �¥WX? @BA_°3E±CDE±CDL_TVUXW�PKO YZW3[p{�H���� � ¯�\¬qdm�j�¤ �¥WX? @BAVF�E ²¡NiO3P³TZU�W�PKO YZW3[�)�DH��K� �X� � ¯´\�qµm�ji¤ �¥WX? @BA�²�EICiEIC

û:ü�û:ü ¶þ1ÿ�������������� ������·¸+��,�¹ 0 ¹ �"!�#�$�2zº�» � ¼V(½��¾¦�9¿�!�-���!�#�$3 bÀ&& <4¬�§��7��8I8S� �9/�#�$��&4�ÿ³�X ³» ·¸+�9Á*�"�� à � /K89#�%� )�2x4�� )�½��7� 0 ��8I8S��!�#

:<;>=<? @BADCDE ²3GIHKJ¬cf W*TVUXW3PKO YZW3[|� ��� ����Ä3�X� � R�� � � ��? @BA e´j�s¦e´jDh<� m�jX^zOf W3[�k@N³ssb��� ;Zg�ÅDTBj �Bh�;i[�h�;i��NiO3PKk3;ih�;De���^ze@���[¬U ��TVU ��gS� ;i��ÅD��U���[3;Dec3O¢ £ [�? @BA k@��oÆbe ¨"[�e�;�j�\�¨Xqef W�N³s Yic�[�e�;�j�\�¨�Ç­ A g�Nik U�g�^ ` a�\e�B`¦k@BA ^ q&O@BA �3h s\�q�\ �B;���� ;Zg�^dc3ef A W�gih f WÈGd:<;>=<? @BADCDE±C�GIHKJ"J

Page 16: Grokking thegimp

É�Ê�˦ÌÍ Î ÏÐ�Ñ É³Ò�Ó�Ô ÕÖ Ñ�× Í�Ø Ó Ð Ì"ÙrÚ Î ÕtË<Û�Ü Î>ÝzÞß3à Û�ÌÍ Ì�á ÓiÒ ÎâBã ÌÍBä Ý Ú ÞÍBä å × æ Ò�Ü�ç�è�Ú�ébá êÜ Ñ ç Ð Ü>Ò æ Ð Ü Ñ�× Í�Ø Ó Ð Ì"ÙrÚ Î ÕtË ÝzÞß3à Û¬ëoá Ü�ëXÓDÜ × Ý æ ÐB× ÌÍ É Þ3ì ëXÓDÜ ×Ý æ ÐB× ÉiÌ Ñ Û3Ü Î>ÝzÞß3à Û�ÌÍ Ì�Ü × Ü Î ÊXêoÙ Ø ç Ð�í ç å ë Þî ï Û�É Þ3ìKÞ ÜiÛ Ý × Ð ÜDÌdð Ø¥ã1ÝzÎßBä à3åXñ*ò ÒÛXÓ�á Ü ò�ì³Ø ç Ð ë�á ÜDÌÍ ê Ï Û à3å á Ü Ñ ë Î ËbÔ�Ü × ë�ÓKÜ × Ô Ð à Ñ Û3Ü Î Ò à Û ò ÜiÛ�Ò Í Öë ÏSópå Õ Ñ Û"ÙrÚ�Ò¦ç ëoá Ü æ à Ñ ÌÍÝ ã ô Ò<Ô Õ�Ó ÝzÞ æ Ý õ ßBä à ëXÓDÜ × Î Ó�ç ÝzÎö Ó Ø ç Ð�í ç å3Î_ì Ë Ï Ô Õ�Ó ÝzÞ æ Þ Ñ è�Ò¬÷¥á à Ñ Û ÎBà Û æ Ð à × â_ÞXøùBä Ñ É å Û Ý ã ô Òvúpû�ë�á ÜDÌÍ ÉKç Ñ>ü�ý�þ û�ë�á ÜDÌÍÝ æÍ�å Ó üoýÿ û�ë�á ÜDÌÍ Ò Ö Ù Ý Ñî Ò ü�ý�� û"ÌÍ ü�ý�� û�ëXÓDÜ × Ý æ ÐB× ÌÍ ü É Þ3ì�� û�ëXÓDÜ × Ý æ ÐB× ÉDÌ Ñ>ü��ù Û�)Ü Ý õ î ä × Ý Ôî × Ý ÛÍBä å ÓKÛ ÕtË Î Ü å�Þ3ìXÝ àÍ�å ç æ à Ñ ÌÍ É Þ3ì Ì�á Ó�Ò ã¦Î_ì Û à Ë Ø ç Ð è´Ò�Ëê�ê ÍBä å Õ Ñ�× Í Ô Õ�Ó ÝzÞß3à Û�ÌÍ É³ËË àßBä Ò è´Ò Ø ç à�ìKÞ ö à ÛXÒ Í Ö øùBä Ñ ë ÏSó Ì3Ü × Ü Î Ê ÝzÞß3à Û Ø ç Ð�í ç å ë Þî ï Û ã � Ü å ÷ßBä à û ����� ü

ÌÍ ê ÍBä Ø ç Ð ò ÜiÛ3Û�Ü Î>ÝzÞß3à Û�ÌÍ3ò ÜDÛ Ø ç à�ìKÞ ö à Û������ ��� ��� � ������� ��� ò�ì�ã¦Î ÜiÛ �è�Ò ÷¥á à Ñ ÉiÌ ç Ñ ÌÍ í"! Î ð"Û Î Ü�ÓiÒ�ð�Ú Îß3à É³Ë ö ë�Û Î ÜiÓ�Ò�ðXËÒ¬Ú�Ò Ð Ü�Ô�á Ü ÑÝ ë ÎßBä à Ñ�× ß3à ÉKÔ�á ÌÍ3ò�ì ÉiÌ ç Ñ è�Ò¬÷¥á à Ñ è>ç�ÒµÕÖ Ò ò�ì æù Ö Ò à3å â á ê ÍBä ë ÏSó ë Þî ï Û ÝzÞß3à Û������ ��� ��� � �#���$� �� æù Ö Ò × Ü Ý õ ßBä à�ò�ìXÝ ã¦ÞÍBä å Ò&ÌÍ è�Ò ÷Bá à Ñ ÌÍÝ Ú ÞÍBä å × è>ç Ì"Ù�Ú Î ÕtËÛ3Ü Î Ì Þ Õt˦ÌÍ í"! Î ð"Û Î Ü�Ó�Ò�ð�É Þ3ì É³Ë ö ë�Û Î Ü�Ó�Ò�ð�ê�Ù Ø ç Ð�í ç å Û3Ü Î ë Þî ï Û�ê ÍBä ÎâBã¦Þ â Û � Î Ì à Ñ ÚdÕ�Ó�êÜ Ñ ç Ð Ü>Ò�ËÒ û �&% �' � ��� ���)( ü ÉKÔ�á Ê Ð Ü�ë ÏSó Û�Ù Þ Õ Ñ ê�Ù Ñ Ü>Ò à3å â á ê ÍBäÚ�Ò Ð Ü�Ô�á Ü Ñ+* Ü õ ë ÏSó Ì�Ü × Ü Î Ê3Ì Þ Õt˦ÌÍ�Ø ç Ð�í ç å Û ç ã�Ï , ×.- ËÒ<ëÍ�å ðIË à�Î ð9ç|Û�Ü Î³ÝzÞß3à Û�è´÷ Ð ÌÍ æ Ü�Ó0/�ç"Ù à3å á Ü Ñ Î Ó�ç ÝzÎö Ó�ê�Ù Ø ç Ð�í ç å ë Þî ï Û�ê ÍBä ÎâBã æ Ü�Ó�/�ç"Ù ÝzÞ ö Û ñç Ð Ü>Ò Þ á Ü Ñ Ú Îß3à Û ç ã�Ï , ×21 ò ÜiÛ¬ëÍ�å ðIË à�Î ð9ç

* Ü õ ê ÍBä4345 û6� ü ÉDÌ ç Ñ Ø ç à�ìKÞ ö à Û ÿ �87�(49 ��� � �#���$� ��� øùBä Ñ Î Ó�Ë Î Ó ×¬æ ÒÜ�ç ý ÎâBã É>ËË É Þ�ì ëSÙxÌ Õ ä Ñ Ý ÛÍBä å ÓKÛ ÕtË õdâ á Û ÕtÒ Ý à Ü Ø Ó Ð ë ÏSó Ì�Ü × Ü Î ÊÝzÎÍ�å Û ç â í ç å�ÝzÞß3à Û Ý × Ò â;: � � �=<?>@� ��� �&A�( < ÿ �87�(�9 � ( ò ÜiÛ�Ú�Ò Ð Ü�Ô�á Ü Ñ Ý ë ÎßBä à Ñ�× ß3à Ú Îß3à ë Þî ï Û æ ÓDÜ>ê ÍBä Ú�Ò Ð Ü�Ô�á Ü ÑB* Ü õ É Þ Ð Ó ÝzÞß3à Û >@� ��� �&A�( <ÿ �C7�(49 � (6Ú Îß3à ë Þî ï Û�ê ÍBä ÎâBã ÚdÕ�Ó õµâ á Û ÕtÒ¬ËÒ�Ú¬Ò Ð Ü�Ô�á Ü Ñ Ý ë ÎßBä à Ñi× ß3à Û3Ü Î>ÝzÞß3à Û æ Ò�Ü�ç*Ú Îß3à�ÎâBã ɳËËÚdÕ�Ó õdâ á Û ÕtÒÛ ö ê�Ù Ø ç Ð�í ç å ë Þî ï Û ÝzÞß3à Û ò ÜiÛ ÎâBã Ô Õ�Ó à3å á Ü Ñ ê ÍBäà3å â á è´Ò ÿ �87�(�9 ��� � ������� ��� ò ÜiÛ�ÒdÕÖ Ò ÎâBã Ô Õ�Ó à3å á Ü Ñ ê ÍBä ë ÏSóvÝzÞß3à Û3Û ö ò�ì�ã¦Î ÜiÛ ËÒ�Ú¬Ò Ð Ü�Ô�á Ü Ñ Ý ë ÎßBä à Ñ�× ß3à ç Ð Ó å ç Õ Ñ Ý ÷¥á Ò * Ü õ ê ÍBä4345 û�� ü

Page 17: Grokking thegimp

DFEHGFI JLK4M4N O�P6Q�RTS4UWV#XZY+V[]\�^ _+[�`ba&Q�c c6d�e8fhg�d�i d�j�c�k lfmI JLK n `JLK o�p4` qsr�^�p&V�^�E�ot)q K t@n [&Xvu)w8xbU�E�yzE�{}|Tn~{J]o�`�V ����V�oTn~^� [�`zn y�t ����k i d��� k Q�i l&������a&Q�c c6d�e8f�����E�`���t �LE#��� E+Xn)u�{� K [&X�y � [���{� [�u�^� � `��p4EHI JLK �zt �LE#��� E+X+DFE�G�S�^ ��p�n~^� [�` � k Qi l#������a#Q�c c8deCf�����{� [Wu�^� � `I JLK {�L��^�p&V�^�E�or�tz�zt �LE#��� E+Xn)u�{� K [&X�y � [.`�E4{Hn ��^JLK ot�^�p&V�^�E�oI��;YZV ����V�ozn~^� [�`�u�^� � `���E�`]{�L��� q�p�[�o�� E+XHI JLK [�o � � �}t�a&Q�c c6d�e8fhg�d�i d�j�c�k lf ��E�`�t q¡ t�^�pV�^�E�o�I JLK u)w8xn~^� [�`�` _+��\���{�E�`&¢�r�t��zt �LE#��� EBX&n)u�{� K [&X�y � [�V ��p4o£V q$Xn ¤�� tWDFE�GFI JLK�M�N OP$¥#R

DFEHGFI JLK4M4N ¦P6Q�RTS4UWV#XZY+V[]\�^ _+[�`.§0e¨Q#©�k dfBc6�;��{� [�[¨w¨�F`�{�x�ª�UC����{ qsrF`�E4{�Y«^�� UJ2u)w8xbU�E4yzE4{�|Tn~{J]o�`�V ����V�oTn~^� [�`zn y�t ����k i d�� � k Q�i l&�����§0e6Q�©�k dfBc6����E�`���t �LE#��� E+X&n)u�{� K [&X�y � [���{� [�u�^� � `�p�EHI JLK �zt �LE&�"� EBX+DFEHGmS�^ ��p�n~^� [�` � k Q�i l&�����b§0e6Q�©�k dfBc6����{� [�u�^� � `�I JLK S�|r�UJ�r�t��zt �LE&�"� EBXn)u�{� K [&X�y � [�`�E4{Hn~^� [�`�UJWUC�¬n~{_+��{�L��U�����{ qsrF`�E4{�Y�^�� UJ�I��;YZV ����V�o�u�^� � `Tn~^� [�`���E�`�{�L��� q�p�[�o�� E+XBI JLK [�o � � ��tWYZV�[]\4^ _+[�`.§me6Q�©�k dfHc­{�L��� q�p�[�o�� E+XHI JLK u)w8xn~^� [�`�` _+��\���{�E�`&¢�r�t��zt �LE#��� EBX&n)u�{� K [&X�y � [bV q$X&n ¤�� t�DFEHGFI JLK4M4N ¦P�¥&R�tz[�`���E�`t J ¡ u)w8x2U�E�yTE4{�|�U]{�LE+X�� q�p�[�o�� E+X�UJWUC�¬n~{_+��{�L��U�����{ qsrF`�E4{�Y�^�� UJYZV ����V�ou�^� � `I JLK ��w®6y°¯#©�k c��E�`�t q¡ t2��\4y JYZV�[]\4^ _+[�`.§me6Q�©�k dfHc]¯&©�k c¨l�e�±² K X&n � ³tWYZV�[]\4^ _+[�`�U�����{ qsrF`�E4{«U�{�LE+X¬S�^]\�S�` ��Y��bS�|�r�UJzV q$X�`�^�� E�p�S�UWV#XH�² ¡ tTyTEvV q$Xn ¤L� tWDFEHG�I JLK�M�N ¦&P8j4R

Page 18: Grokking thegimp

´FµH¶F· ¸L¹4º4» ¼½6¾�¿TÀ4ÁWÂ#ÃZÄ+ÂÅ]Æ�Ç È+Å�É�Ê�Ë�Ì Ë�Í�Î&¾�Ì Ï�Ð)Ð6ÏhÑÒ ¹ ÃÓ Ô�Õ¸]Ö×;Ó~Á�Ø Ù�Å�ÚTÛ�µHÚ�Á¸�· ¸L¹ Ó É ÈZ×�Á¸WÁ�ܬÓ~ÕÈ+Û�ÕÝLÔzÄLÞ ßLØTµ�É�ØTµ�Ö�à�Ç�µ�ÖzÀB×�×áÓ~Õ¸]Ö�É� Ý�ÄZ ßãâ�Â�ÖÓ~ÇÙ�Å�ÉzÓ Ø�Ú Ý;ä#å Ì Ï=æ?ç@å ¾�Ì Ë&è�é�æ�Î&¾�Ì Ï�Ð)Ð6ÏêÛ�µ�É�à�Ú ßLµ#ë�ì µ+ÃÓ)í�ÕÙL¹ Å#Ã�Ø Ù�Å�à�ÕÙ�Å�í�Çî ï É�ðÞ4µH· ¸L¹ à�Ú ßLµ#ë�ì µ+Ã+´�µH¶�À�Ç ß�Þ�Ó~ÇÙ�Å�É£ç@å ¾�Ì Ë#è�é�æ�Î#¾�Ì Ï�Ð Ð8Ïhà�ÕÙ�Å�ñ ßLµí)ò8óbÉCÜêÇ ô$ÃB·�Ü;Ã�µ�ÚzÅ�Ö Ý ì · ¸L¹ àzÚ ßLµ&ë"ì µBÃ&Ó)í�ÕÙL¹ Å&Ã�Ø Ù�Åbí)ò8óbÁ�µ4Øzµ4Õ�ñ]Á ô ¹ ÃHÛ�µ�ÉWí¸]Ö)õ6×�Å]Õ õãÂ] ß�Þ�ÖWíCÜhÁ ô ¹ Ã0ö�Ê�Ð$ÍCÌ æ2÷?øhÄZÂ�Å]Æ�Ç È+Å�É�Û�Æ�À�ÁWÂ#ÃH¶@µÓ~Ç·�Á¸�· ¸L¹ í)ò8ó£É�ÜhÇ ô$ÃÓ~ÇÙ�Å�É#ù}ú ß�Ã�µ�ÚzÅ�Ö Ý ìHí)ò8óbÁ�µ�Øzµ4Õ�ñTÓ~ÇÙ�Å�É� ÝL¶@µÓ~Ç·�Á¸�ÀB×�×�ÅÙL¹ ÚWÄZ ß�Ÿ]É�Øzµ�É�Øzµ�Öûâ�Â�ÖWí�Çî ï É· ¸L¹ Ô ü�µ�Ö�ý�Ï�Ì Ï#þ�Ð. ô$Ã+´FµH¶�· ¸L¹4º4» ¼½$ÿ#¿�ÚzÅ�É�Û�µ�É�Ú ¸ �}í)ò8óÁ�µ�Øzµ�Õ}ñ]Á�ÕßLµ+ÃH¶@µÓ~Ç�·�Á¸�ðÅ&Ã�ë ô�Þ�Ó Å&ÃZâ�Â�Ö�í�Çî ï É· ¸L¹ Ô�ò �6Ø�����å Ð�Ó ¶ ÙL¹ ÅTÓ Ô� Â#ÄZÂ�Å]Æ�Ç È+Å�É�Ê�Ë�Ì Ë�Í�ø¾Ì Ï�Ð)Ð6Ï����Wå Ð]ë ô�Þ�Å�Ö�ì µ+Ã+´FµH¶�· ¸L¹�º�» ¼&½8þ4¿�Û�µ�É�Ú ô��Ú ù�à ß+Ó~ÇÙ�Å�ÉÁ]ÕßLµ+ÃZÄZ ߫ë�µ�ØFí�Þ4µ�Ø�ë ß�Å&Ã�É�µ4Õ

Page 19: Grokking thegimp

� �� ����������� �������� �"! #%$'&#)(+* �-,/.1032547698":<;>=�?+.�0A@� B� ��C9DFEG! HA )��� �I69JLKNMO;>?

P/QSR T U VFW TX�Y�Z [ X�Y<\�]^Y�_`Na R _ V _�bdc ] VFe ` U PgfihjPOkmlne�l ]%o P[�_ P/QSR T U Vqp Y a ] l^r st)u�vxwzy|{~} ]^Z�� y�� P/QSR T U Vqp Y a ] l^r a � o>o T Y e � a } ]^Z��` l ]�b y�� r _` b ur y �Fa Y �x_�b r a` U b k a T o P/QSR T U VFegTX V�R _ V^e ` U R3Q+P T�����nU V�PgfihjPOkml5� ��� �x_ VFedQ+POk ]�� r W �n] p��

} ]^Z e ` U���� � � R u V � T�k _�bdc ] V v�u _ �my � _ a<a ] l^r st)u�vxwzyg{~} ]^Z��3�%������� ����� �����<�m  PiQ¡R T U V a ] l^r st)u�vxw¢y|{~} ]^Z1Y TX�Y R ]���] l¤£¥edQ v�u �d¦ y ]�b k§N¨` u � k b a T YP[�_ a ] l^r y[�_ a r ��Y ©Lª

� « �­¬¯®�°¥��� � ] a ¦ Y �n] � c ] V¥rgP�l[ U _ V � [�_�¦ l[�_ P y§ ± a W¥k ] e ` U ¦�Y �n] � c ] V } ]^Z²� y � kOr y[�_ a ª� « �³¬�®�°��¥�A¦ l[�_ r y[�_ a R T U V%� ] a

P` b { o�_ l {9u�u � k b P/QSR T U V�´ µ>¶¸· « ¬�¹º� v ��c k c ] Pgfih a Q y T¸VFedQLV ]^Y�_�b ©c e ` U ¦�Y �n] � c ] V¥rgP�l[ U _ V � [�_O¦ l[�_¥¦ Y �n] � c ] V } ]^Z a � � ]��

Pgfih¯R ]�� ] l¤£�P �dY�¦>] vxw¢y|{~} ]^Z v�u � � ] a v�u r»l� P�e _ l` U vxwzyg{ W _ VmPgfih¼� ] a } ]^Z � T�k _�bdc ] V^e ` Um��� �¡� � Z1o k c ] vqu r»l� P¥e _ l` U � � s�l ] a�½ _�b ©c e ] V

� �n]�b<� [�_�� y��^¾[ U _ vxw¢y|{ e ` U _�b ©c p Y vqu r l� P¥e _ l` U � � s�l ] a�½ _�b ©

c e ] VFW¥k ]�� [�_ a ] lqP y§ ± a e ` U ¾[ U _ vxw¢y|{ � � � ` � £ o R` W� X�Y���] r Z [ U _�� R u V^k c ]q¿ s�l � a l � a Q y T¸V^e�QV ]^Y�_<b ©

c e ` U vxwzy|{ Y TX�Y�Àº� yN� £ �n]^¦>] a vnwzy|{ Y TX�Y r s Á Y vxw¢y|{~} ]^Z � � � ` } ]%Z � T�k _�bdc ] VFs�l ] a¥Â e ` U ¾ c _ VGÃO· �%Ä�� �%Å e ] V u �n]^Y y c ] V^W _ V v�u _ �my � _ a £ �n] vxwzy|{} ]^Z1Y TX�Y v ��c rgP b £ © a r st)u

��] a c _OY Pgfih¯R ]�� ] l¤£ y _ V u © }]^Z � T�k _�bxc ] V v�u ��¿ u b a ] lqP y§ ± a e ` U ¾ c _ VGÃ<· ��Ä�� �^Å r Z [ U _ R T U Vqp ¦ �n� `Na ] l � R u V } ]^Z � T�k _<bxc ] V

r � [ U _ Pgfih Z1o vnwzy|{ e ` U � �x_ V a ] l � y � kFp ¦ � P y§ ± a s�fÆ ��®�Ç u �n]^Y y c ] VFW _ V vqu _ �my � _ a ¦ l[�_ u T o r o § X y P y§ ± a e ` U ¾[ U _ vnwzy|{ r Z [ U _�b[<Y>b T Y a ] l^r st)u�} ]%ZÈY�_ a � ] a Y ` XPgfih�R ]���] l¤£ r st)u�vnwzy|{~} ]^Z�¦ y ]�bOÀ vxwzyg{ Z l �x_�� a T YN¿ u b a u s�fÆ � r � �n] R { P �n] V v k � p Y WOh � e ` U y ] a r � �n] R {gv s o>Y ¾[ U _ vnwzy|{ e ` U Pgfih � �x_ V a ] l ¦ l[�_ a u s�fÆ �´ ÉNÊ � Ë ¶ ¬�o>Y P` b { o�_ l {9u Z l �x_<� a T o P y§ ± a vxw¢y|{~¾[ U _�� l a � yN�^¾[ U _ Rgf u e �n]�b e ` U Pgfih � �x_ V a ] l²r Z [ U _ r y[�_ a r st)u�vxw¢y|{ e ` U � ` ¾[ U _<_�b ©

c �§ u a T Y egTX V ¦>� u � � c £ �n]^Ì ¾[ U _vnwzy|{ e ` U Pgfih � �x_ V a ] l _�b ©

c ¦qc ] V a T Y p ¦ � r y[�_ a<a u s�fÆ � ´�µ�¶¸· « ¬�� e Yy T aOÍ h � r Î Zz] � W _ V�Ï �|Ð Ãme ` U � ` s�l � ¿xb ¾ Y { _�bdc ] V b§ U Vqp Y a ] ldp ¾ � P/QSR T U V¥r st)umvnwzy|{ P[�_ a ] l Z § ��Z {~¾[ U _ p Y ¾ c _ V�É �¥« ��Ñ ¶ � �O� e ` U _�b ©

c u �n]^Y y c ] VÒÔÓ Õ Öi× Ø^Ù Ú�Û Ü × Ý¸ÞißFà5á�â9Ó ãä�ådæ'ç�è éxê ë × Þiì íiî^ï ð ñ-Ó ß òi× óxÝ-ôná�à�õ öí¸Ó ÷ë�ø ß æ Ø/ù æ¸å íiâ¸ú-û|ü æ'ý í

Page 20: Grokking thegimp

þ~ÿ�������������� � ��������� ������� ����� � ��!�"�# $%���'& (��)&+*-,9ÿ��.# �0/1� �+�2435� & 6�7���8 9:� 9gÿ�;�& (��.&:*<# �0/1� �+��243>= ?�@A# �0/"813B�A������CDFE ���%GH��*081� $%/I�.����ÿ J-��KL�MONP�96�7Q*-NR��3 *<�TS+�U3V8W��3B�X�"�Q#(���CDFE ��YBZ $%� �F#[S+�!���F#(P� ,�� \V, 6 E ,+�]��� $R�\1����� �^��1� 6CDFE ���%G_�Q*-, 6 E �` � �a# $:�U� $%/ 7.# �0/1� �+�243F, 6 E 9gÿ�;�& (��.&:*Q�F/ $�8�þ)�[�'�` � �P�X\V,P\�� � $F\W��/I\1� D �b7"�)# �0/1��7:� \���� C%� �Xc $F\��%GH��*-�����[9gÿ�;d�6CDFE �/�� \eLM�f[gXhWL LM�f gihWLM"M�f[g)h L LM�M�f[gXhjL�M�f[f g�g^81��kL�M�f[g"f[g^81� $%/l9gÿ�;m# $%�[�1�"\ 3'� �n �[�FG_��*LM�f f[g�go�\1����� �U9gÿ�;b& (��.&+*�L�M�81� $%/I�)�lK�LMpCDFE ���%GH��*-, 6 E �U3B\1��qP,P\��V��/I\1� D ���1� 6",��� �VZ!�a�lrTCDFE �d9D �sL�M�f[g)hjLM�M�f gXhWL�M�f[f g�g^81��LM�f g�f[gtc $F\[9gÿ�;�& (��)&+*tft� & ( E �U� � ��uLM�ft81� $%/I�)�lKL�MpCDFE ���%G_��*-, 6 E �U3B\1��qP,!\��V��/I\1� D �"�"I� 6",Q�� �'ZP�R�o@eCDFE �d9D �vLM�f[gXhjLM�f[f[g"g^81��LM�f g�f[gvc $F\[9gÿ�;b& (��.&+*0� � ��uLM�f ft81� $%/I�)�lK�LMpCDFE ���%GH��*-, 6 E �U3B\1��qP,P\��V��/I\1� D �"��1� 6",��� �VZ!�a�^w_CDFE �d9D �sL�M�f[f g�go/(�x6���\I3V� �n �[�%G_�Q*08'NPNP� 6 � ��� $3 �yNa��\I3B7"�"�P3 �yNR�\1�Xz { $0Y�C $0�W\V�U96�7Q*-NR��3 *<����j�X/W�P�X\1�"/|� \�� � ��!/(�x6P� �n �[�%G_�Q*Q�W\V�X, 6 E þ���/I�X8I�� 3�/��X�}3��/]SB�"7X� ~�&>\I�z { $:, 6 E � 6��FG_��*Q�1\V�X���5�X/W�P�X\I��� � DFE ���V�\I�.9gÿ�;�þ"\1�X\ 3Bc.9 $:�XZ!\��%GH��*��\I�[���X�}3�19�,!��36 E ,Q�� �'ZP�R��, 6 E 9gÿ�;d� 6�� $%/I7��"\ 3%& (��.&+*<# �0/I� �+�243V8 9:� ����� �6 E # �0/

� \V&a, 6 E wI��w'����LI�u8�þ.�[� # �0/1��7%� \�������� � ���"����\I3FN-�y�), ` � � \W&����"L1�[� �1�^�}�eL ��� �, 6 E � �(X��\I�.9��Sþ � E �j��L1�1�j�a�p9gÿ�;¯þ�\1�X\I3Bc!�}36�7"�!� �n �� {:����� � ������ 6 � ��� $0S��"7)9��( �����/I\V, 6 E Z)� $F\[#:� \�� � \V&581� $%/�}�D ���d� � � �O�i�"L1�I�j�R�H����� � ����������W��\I3FN-�y�), ` � � \V&>� 6.� �+��24;i�9�� $F\17�� �yN!�����I� �������\I3V� �n �[�%G_�Q*.9gÿ�;�þ"\1�!\I3Bc�N-�y�X, ` � � \V&j� � ����%GH��*0�Q�(��., 6 E � 6���7 { � 81� $%/�ZR3D ��N��y�), ` �X� � ��.�>GH��*QYBZ!��� S��"7�3�VN�ÿQCDFE �, 6 E # $%���W��\I3:YB�.C%� ���e����� �[f1�|� ���, 6 E ��7 { �� $F\V�R�:� \'��þgÿ�������������� � �����X8I� $%/'YBZ $�9��( ������ÿ J-�u�e�m� & DFE ��7D �!7 �y�!��\I3FN-�y�X, ` �

9gÿ�;¯þ"�)N-�F#("& (P�Q��2_�6����7%� \��T9D �d9gÿ�;¯þ�\1�X\I3BcN-�y�), ` ���%G_��*-&H3$%���X�|�5Z)�U��3{F�48'NPNP�������%G_��*.�|�[� � �e���" ��eL1����SB�"7"��\I3�3�WN�ÿ�3{F�]8'NPNX�%G_�Q*#:� �"�\1��CDFE ��YB�.C%� ���e����� � f1�|� ��]��� $��}��7i� CF� �¡9|ÿ�;^3�WN�ÿQCDFE ���%G_�Q*0� � ��d���[�"� ¢�£��^81� $%/W,:�e��\I3FN-�y�), ` �l�%G_�Q*-� 6 � � ���"Ic {B�N-�y�), ` ��Y�Z $�� � ��R3{F�48VNPNu¤�¥"¦�§

Page 21: Grokking thegimp

¨0©UªV«W¬�ªB­u®p¯}°T±�²"³1­!³IªB´Xµ ©¶]· «1¸�¹Wº-»y¼X½ ¾�¬�¿%À_¸QÁQ¿ · Â:à ¸�³1Ä�ªÅF©4«VºPºÆµ}ªÇ Ä�¬ · Å:¿ ·  ½ ÇFÈ µ ­.¼ Å>É�ÊWËIÌlÍeÎIÏ�Ð ÑÒWÓ · »�Ô Õ »0Ö1×�Ä%Ø ³�Ô�ÙU³VÚa½ ÇFÈIÛIÜ�Û'Ý�Þ�ß[à×�Ä%Ø ³�Ô�¿�ª�á â1Õ"³1­^­Ç ¿%ÀHã�Á�×�Ä Å Ø ²"³1­!ªÅF©4«VºPºP½ ÇFÈ ä�å  Ô1³V¼>µ æ�Ú>³I¹Iá »yºX¨0©UªV«1á�ªB­u®p¯}°T± å ¼ ç · «IªBá.èé ×�¿%À_ãQÁ0«'ºPºiêXë4ì5í¾ È Ô�µ © î�¼�¿%ÀHã�Á-½ ÇFÈ «1² · Ô[èÖI³1­Uµ © î�¼®p¯Q¯}°T±bµ ¼ éFÈ ×�ÔWï³1á!µ © î�¼PªÅF©4«'ºPºX¿FÀ_ã�Á å ¼ ç · µ ·Ç ÄÖ1½ ÇFÈ ´ ÅBá×"×�á!«'ºPºa­X³�µ Ú éFÈ × ä à  ²"³1­!³IªB´Xµ á â�ºPº-»y¼X½ ¾�á!«1ã�¹«1² · Ô èQð�ñ^²"­.º-»FÕçdª�ÖI­.½Q»ò Ô1ã »+áóHñ^¹�µ æ�Ú>³I¹Õ:Ø ³�ÔWôTõ×[Ô�¨+©UªV«Wá�ªB­u®p¯}°T±[×�Ä:Ø ³�Ô1´ ÅBá)Õ Â ×�Ô5ï¾�Ô ä�å  ¿ ·  µ æ"Ú_³I¹ ä ¼m®p¯}°T±bµ ½�Ø ³V¼�»ò ¼u´  ³�¿%ÀHã�Á�Ùa³VÚUõ�×�Ô èQð�ñbºWØ ªBª�ï"¹'¿�Ö Â�·  ÖIÄ Ã ã"³1Ä"ô.µ}ãXµ Ä"×�ª Áyö[« å ¼>«V¼Pãà ªé ×AÚ>³I÷�èQð�ñi²"³I­X³IªB´º-»y¼)½ ¾�á · Â Ö Ä�ªÅF©4«'ºPº^ê)ë4ì�µ Ú éFÈ × Ã ãÇ á!µ}ãÇFÈ Ä�Ô èÖI³1­>µ}²Ç Ä Ã ³1Äõ�×�Ô åç ò ¼�Ô1³V¼øµ Ú_ªB³I¹p®p¯}°T±bµ © î�¼.¨+©UªV«Wá�ªB­ å ¼ ç · µ ·Ç Ä"ÖW½ ÇFȵ ©¶]· Ùa³WÚUï³1á�¿%À_ãQÁ[êXë4ì'¼!×�áï³Iá�¼ Ç ò èQð�ñi²�³1­X³ ª�´!µ}ãé ×�áº-»y¼)½ ¾�á[¿FÀ_ã�Á�ï"³1álê)ë4ì�µ © î�¼.¿%À_ãQÁ å ¼ ç · ×éFÈ ¼.¿ ·  ½ Ç Ã ã »�Ô · Å�ªB³1Ä�ã�¹µ ×Ç Ä · µ Ú ç È ­>µQÕç�­.½ ÇFÈ Ã »0ÖWõ  ×ù Ü ú"Ü�Û «Iã�¹ ù Ü ú"Ü ù µ áÇFÈ ÄÖIá »yºPõ  ×)èÖ ª�ª�¹1Ö »�ÔWá%Ø ×¼)½:ûeá�³IªFº-»y¼)½ ¾�á[¿FÀ_ã�ÁQÔ1³V¼>µ © î�¼PªÅF©4«'ºPºX¿FÀ_ã�Á å ¼ ç · ×éFÈ ¼

²�û à ª »yºUªÅF©4«'ºPºX¿%ÀHã�Á å ¼ ç · ½ ÇFÈ ²"×[ÔV½ ÇFÈ ä�å  Ô1³V¼>µ æ�Ú>³I¹Iá »yºX¨0©UªV«1á�ªB­u®p¯}°T±oèé ×i±1ü!ýA­ Ç ¿FÖ Â ²|û à ª »yºaá�³IªFº-»y¼X½ ¾�á�Ùa³VÚ_ã"Ö · ã"³1Ä Þ ±�Ê1Ï�Ï-Ìþ�Ò à×�Ä%Ø ³�Ô�µ å Ø ¼aÕ »0Ö1×�Ä%Ø ³�Ô1ã"Ö · ã"³1Ľ ÇFÈ ©UªB³1á�ÿ ä ¼�¿ · ×�¹ ã â�×�ái±�Ê1Ï�Ï-Ìþ�ÒkÉ�Ì�� Ì��1Ï|Ð Ñ�Ò]¨ · Ä�ª�¹Wº0ð�ªÅF©4«'ºRº�±1ü!ýbÕ:Ø ×"ï³Iá åéFÈ ×�¿%ÀHã�ÁX«Iã  ÖWº-»y¼X½ ¾�á�¿FÖ Â ä ¼�¿ · µ}ªâ1è�½!×�ªÇFÈ��� Ü � Ð �TÎ � Î�ÊWÏQÏ-Ìþ�Ò1ÓTµ Ú éFÈ × ä à  Ùa³VÚUõ�×�Ô èQð�ñb©UªB³Iá ä ¼�¿ · ×�¹ ã â�×"ád±�Ê1Ï�Ï-Ìþ�ÒkÉ�Ì�� Ì��WÏ�Ð Ñ�Ò ä ¼Uè�ª »ò Ô Õ � ×�¿%©P½ ÇFÈ èQð�ñ µ ©¶]· µ õ  ³ äFå  ¨+©UªV«Wá�ªB­ ªÅF©4«'ºPº¿FÀ_ã�Á å ¼ ç · ½ ÇFÈ ²"³1­Rèé ×�®����d²|û à ª »yºaá�³Iª�²�ªÂ ³'Ô1ªÅF©4«'ºPºPÚQÅ � á »y¼i½ ÇFÈ èQð�ñuÕ Â ×�ÔWá�³Iª_ã »+á�óHñ^¹Iá"³IªF½:û4ÔW³V¼!ï"¹µ à ­ é ×¼!á »yºX¿%ÀHã�Á|ãÖ · ã�³1Ä^µ Ú Ç Ä�Ô�« Õ �µ ©UãÇFÈ Ä�¼.¿%©Pº-»y¼X½ ¾�á½ ÇFÈ ¿ · µ}ªâ1è�½!×�ªÇFÈ ��� Ü � Ð �TÎ � ß þ��1Ó��1Ì Ólµ Ú éFÈ ×½+û ä à  Ùa³VÚa©>ª�³Iá�ÿ ä ¼.¿ · ×�¹ ã â�×�á��!þ��WÓ��kÉ"Ì�� Ì��1Ï|Ð ÑÒ

������� ��!�"�! # ��$�%&�('�)+*-,/.1032&4�57698;:=<�41>Ùa³VÚa½ ÇFÈIÛIÜ�Û[Û «1² · Ô[Õ »0Ö1×�Ä � ³�Ô�¿ · ×�¹ ã â�×�á�Ùa³WÚ ä à ­?� ÞA@ ÌCB ¯ �&D � Ì à í¾ È ÔVï�¹�«I² · Ô'õ¾ ò ¼!­!³�µ ­ éFÈ ×)èQð�ñ¡µ}ªÇ Ä"á!µ ©¶]· ¨ · Ä äFå  è�ûp² » È Ô @ ÌEB ¨ · Ä

²�³1­X³ ª�´½:û4¿ · Â:à ã�³1ÄÖçGFÇ · Â Ö Ä"á »y¼¡èé ×bá"³IªVµ}ãé ×"á!µ ­.¼ Å4ì[Ð � ÌIH @ ÌCBÆï³1á à ¼  ³[Õ � ³�Ô�µQè�ªéFÈ ×�Ô1­ é × Ã ªé ×.è�ãç J�á�õ�Ö ³V½ ÇFÈ Ã ¼  ³[Õ � ³�Ô�Ùa³VÚj«1ã  Ö"µ ãé ×�ádì Ð � ÌKH@ ÌCB à ªé ×Xµ}ãé ×�á�² » È ÔVï³1á)èÇ Ä�Á-ºR×�ª Á ·.·  ÖIÄ)è�ûk² » È ÔML)ë+N|þ�� H;OuÒ]¿�­P� ÖA� ³�è�ð�ñiá�ûpã »�Ô'½:û4Ô1³V¼X×�Ä Å � ½ ÇFÈ Ã ¼  ³�Õ � ³�Ô�µQè�ªéFÈ ×�ÔW­ é × Ã ªé × Ã ¼  ³[Õ � ³�Ô'Ùa³VÚ>á âB¿ · Â

ã »+á�óHñ^¹ ²�ûTè »3Q�½ÇFÈ ²Qð · ä ¼Pá"³Iª�²�ªÂ ³�Ô�Ùa³VÚ ä à ­P�Wèé ×"á�³IªBá|û à ¼ · å ¼ ç · õ×�Ô�Ùa³VÚ Þ ¯ �&D � Ìeý�R[Î�Ì à í¾ È Ô1²"³1­!³IªB´"á|û à ¼ · ä à  µ © î�¼«VºPºS�)®&�PöW®eþTD/R1ÓEU�D�� Ìlª�ÖI­.½Q»ò ÔWá�³Iª�Õ »ò Ô è � ³[èÖI³1­Pã�¹µ ×Ç Ä · õ×[Ô'Ùa³VÚ Þ �.Ì Ó'Ñ�� �EN|Ð ÑÒ à ·  ÖIÄ�á"³IªBá|û à ¼ · è � ³ ä ¼ å � ×[ÔV�.Ì Ó'Ñ�� �EN|Ð ÑÒ]ê¡«1ã�¹XW¨ · Ä©aá.Õç�¨+©UªV«Wá�ªB­Xï"¹Iá�û à ¼ · è3� ³�èÖI³1­!ã�¹�µ ×Ç Ä · ¿FÖ Â ½ ÇFÈ�ú ù Ú ç�á!µ í�ã.Õ � ×¼ ç ò Öeí¾ È Ô�µ © î�¼aè � ³V©Uª�¹I­X³Iñb½ ÇFÈ ²× · è�ã  ×�ÔWá »yº_è � ³[èÖI³1­Pã�¹µ ×Ç Ä ·�à ¼  ³1ï�×è×�­)Ú ç�ÖµQÕ×�ª Á"´  ³[èQð�ñuÕ Â ×�ÔWá�³IªFÚ ç�­)Ú+Á�Ùa³VÚ>ï³1á�ÚHªç ò ¼)½�Á0µQÕ×�ª Á-½ ÇFÈ ­ Ç èÖI³I­!ã�¹µ ×Ç Ä · ² Å:ÔTèQð�ñuèÖ ªBá|û à ¼ · è � ³[èÖI³1­!ã�¹µ ×Ç Ä · õ�×�Ô�ÙU³VÚ ä à  ² »+­.Ú�»y¼1F Á�á »y¼·  ÖIÄ

Page 22: Grokking thegimp

Y�Z [(\&](^`_bacaed&fhgji1f�kmlGn�o�p�l1q rK_+s&tbuTv�w=r�x�r�wy{z |E}C~G|��������V�&��� ��|� zX}��1� ����9���� ���/��� � � ����~���|E}/��� � }/�G���G|��� ��� �C��}��   y���¡ �¢� £ ¤�¥ z |� z¦}��1� � ��£ ��� ��§ z ¨©��������|{ª=�E�1�A«j¬+| � �1¬=� � � �­�®§��¯  ��� � ��°­�®h± �&²´³µ ��¶ ® ~G�   � ¤�·µ � §�|­�£ ® � �&¸T¹/ºC»C¼�¹©½ ¾-}E�1� � �� ��¿����=� �(� ��£�À }/���Á� Â�Ã�¾CÄ�¾�ÃÅ���=� �(� ��£?Ƨ � ­�£ ® � ³��/~Çz � �È ~ ®É �+��«�¬1| � �`���¢�V�c�   ¤ ����¬1ÊË  ³�� ¥ �P  � « � �E�(�1�+|� z¦}��1�Ì� Â/Ã�¾CÄ�¾�ÃÍ}/����§ z ¨©�Χ�|­�£ ® �CÏ |P|��+��� � ��£ ³��� � ® � § z ���£ ¡��+|� z¦}E�1�� �E� ³��/~Í� Â/Ã�¾CÄ�¾�ÃÅ��¬ ��§ z ¨©� ± �&²Ð§ � ­�£ ® °9Ñ�Ò � « � �E�X� � � ~G�   � ¤ ������� � � �E�1~ � �`�����V��Óµ�£ � ���/����| ·©� « ¥ � �{y���¡ ° �É È ~ ¶ ¤ � � ��£ ¬(� �����   � ��� �E�j}�� � ¤

§��­�® ~ ° «M� � £ � ��Ô&¹�Õ�¾ÅÖÐ�j×Ã�¾ÅÖ ± �&²

Y�Z�Ø1Ù{ÚÐÛTÜ Ý Þ=ß9à�á�âcã¦sTÜ�aåä æMv�w=ç�è�_bs�t(é�Ú�ê{ë Úìä d�r�w=ç�è° «M� � £ � ¡ � ® ��~G� � �í}/��� � «jÓ � «c§ z ¨©� ®� ~�� ® ��° «M� � £ � � ��£ � � z |P��y ¡©���mîA� � � � Ñ ����«j¬+| � �(y{zË|�}/~�|��������V� °¢Ñ�Ò �����(��| · §��­�® ~���� �{y���¡ ° �É È ~ ¶ ¤ � � ��£¬(� �����   � ��� �E�ï§��­�® ~;ðÃ=ñ ò�ÖÐó Â/Ã�×�¬+|­�®h± ¾�Ã�×V»�� ® ~�³��/~©� � � § � ­�£ ® ° ¤ �/���G�� ¤ ~�����~���| ��� � � �E� °9Ñ�Ò ���/����| · � � £ � ³��/~ °� ¡¢îô� ® | î�� ¥ � �P� � ¤ ¡�z Ñõ �

ö(÷ òm¸�½ ÖÍø-ù���«�¬1| � �b~���|�¡ � ® �1~�� � �e}���� ö=÷ òA¸A½ Ö;øи���«j¬+| � �b~���| � «jÓ � «ú³�«j� ¤ � ° | ����E¶ ® � ~���|�¡ � ® �1~�� � � ���/����| · ~A«j¬=� � ¥ � � � ��£ ¥ � ® ��� û ® ~��¸T¾/üô¾�¸T¾©Â�¼�¾�»Å§�|� ¡�~=� � ¥ � � � ��£ ¬=� �����   � � § ° |­�£ ® � � ­�®ý ��� � ° «M� � £ ��þ ñ ½ ¾ÅÖÐ��¸T¾/üô¾�¸T¾©Â/¼�¾�»&ÖÐð�Â�ÿñ ¸9×�ÂÔ&¾ÂEò

� �E� � ��£�� � ��� }/��� ��°   �©§�|É £ �+� � � ¶ ® � ³�«j� ¤ � ° | ���� � ��£ ���/�(��| ·�� «&~���|�¡ � ® ��~G� � �¦§ �   �/~ � � À ° | ������¢� �E�X� �{¤�® ¡¯  � � }/��� � ~���|E§ z ���£ ¡©��³�«j� ¤ �§ z ¨©� ��� ° | ���� Óµ�£ ��°¢Ñ�Ò �����(��| · ~�«j¬(�b� ¥ � �P���/�b� � ® � ~���| y���¡=� � ® ��° «j� µ � ·µ � ³�«j� ¤ � ±�� � ¶ ® ��° ® �=� É ¤ §9� ® | î ¶ ® ��°9Ñ�Ò � � ¤ ¡�� � |��/¡G����§ ®� ¡=�§ � É £ � §9�É � ¥ � � � ��£ ¬ �{¤ ¶ � ®h± ð �� �Vð °9Ñ�Ò ����� � �É }��©�1��¬ ��� ³�|P|�¡9î ¶ ® � �����V� °­�® ° «M� � £ � ¡ � ® �1~�� � �1¬1���/¡ ¶ �� �b� ® �;Óµ�£ � § |� ¡�~�� � ¥ � �{y���¡�~���| ° �É È ~ ¶ ¤ � � ��£¬(� �����   � ��� �E�í§��­�® ~�§ ��� ��� ñ ¹�½ ×Õ�»&ÖÐóbÂ�Ã�×��Ëñ »?òô×�¸¢ºc§ � ­�£ ® ° «M� � £ � � � � · � ~(§��­�® ~Á³��Ez |��/~�� � �E��§�� û�~�¿ � ò����Ô���Â/¹�ñ ½ ¬+���/¡ � �E�`Óµ�£ � }/�=� ��¶ �� �� ® �1~���|E§ z ���£ ¡©�Î}�z � � � ��£ § ~É � ¶µ � �1~ � � � �C�¦���/���A«V� � ����! "$#&%' ($)�*,+ *&-/. 01%32'4651. )47$8 9�:�; #< ; =?>@:BA6CED #3FHG<I�JLKM# ;ON G&P Q1R S T,U1QWVX)�0 9 ( D Y 7$8'Z G&[1\ R JMG^]�Q1G_P` . )47$8 91:�; #' '. 769!;6A (�FBG<I�JbaB\ c&P JMR dWKM# ; . e : (f�\ Q'gh. ) i :kj \ TMl J^mMc

Page 23: Grokking thegimp

npoqpr s�t�u�vwu�xzyB{b|?}?~ �<�B�3�^� o�}�����| �'�O� ��<� ~�� ��� o��� ���s�t � � y����?}���W}�npoq��!|L�Wnpoq�u�vwu�xW�$���,�B�&�?�OyB�����X���OyB{b|?} � o��� ���s�t � � y����?}�3�1� o�}�~^� ��� � � t �W}�r s�t � �� |��� �<�O� �'� �L¡�¢ ¡?�B£�¤ ¥�¦§~ �� }Wy�~^� � o��6{3�¨�o�}�~LoB©�| ¨1��� � o���E~� ©�{sb�W}@ª1�«{^� � � npoq�uBvXu�xW�$¬��,� �X¡��OyB�3���E­w�OyB{b|?}�ª@|������ ®�� �°¯ ¦�¬L¥± ¤ ²�£w¥L³µ´h¶� t }�X� � r � �3� o��� ���s�t � � y����?}?~LoB©�����| �'�O� ��<� ~�� � r s�t � �� |��� �<�O� �'��npoHq

· � npoq�uBvXu�x ·!¸ ¨M{ �&}�� � ~���� o¹npoqº£�»?¼?½��L¦B��¤ ¢!r s�t © sOyB{?}�ª@¾ª!��r�¿X���!o ��À y�{b|?} ·!¸ ¨M�Á ¨�Â� }�n�oqp� Ã�Ä�ÄEÅw�X� � r s�t � �Æ� �&}WyB{/|?}�3� Á � · � ¸ � ¨�o?~^� o�}�npoq� o���r^�Ç}Ho � ���W}�È��Æ{ � t }H� ¨1� ��� � �'�É� ¯ ¦�¬�¥?���M|L��q � ©/q,¿3Ê/Ë�£&³�¢ ÌÎÍzÏ · � ��ÐÑ�Hr s�t � �Æ� �&}�r^�Ç}Ho � �3� Á � r s�t ¸ � ¨�o?~^� o�}�npoq«ÄL��� � Ò ��� o��!� ¨�oB�ÓyB{W}@ª@¾Hª!��r&¿ª��p� �&}��µ�Ó� �L�3� ¿Xr s�t { Á^} � ��� o · �O� �1� �W}����W} ¯ ¦B¬L¥ ± ¤ ²�£w¥L³µ´Ôr^� ·!¸ ¨,npoq�r s�t yB{/|?} · � ¸ � ¨�o?~^� o�}�npoHq¹� ���s�t � � ª��Õ| ¨1���Ö{^� � �O� o���r^�Ç}Ho � ���W}?È��Æ{ � t }r,�¹¶ � ��&×b¡�¬L¥?�W�!|L��q � ©bq,¿�Ê/Ë�£�³�¢ ÌÑÍ�³ · � ��ÐÑ�Hr s�t � �Æ� �&}�r^�Ç}Ho � �3� Á � r s�t ¸ � ¨�o?~^� o�}�npoq«ÄL��� � Ò ��� o��!� ¨�oB�ÓyB{W}@ª@¾Hª!��r&¿Eª1�p� �&}W�µ�Ó� �L��� ¿Xr s�t ~^t� � ��� o · ��� �^� �W}���W}¯ ¦�¬L¥ ± ¤ ²@£w¥L³µ´ � � � Ä�o ��� s � ÈEÅ$ÐØ� �&}B{3oB©Óo��MÂ��µ�� � � �µ�Ó� �L�3� ¿$� � � · | � ®!ª@| ¨ · ��� �^� �W} ¯ ¦B¬L¥ ± ¤ ²�£w¥L³µ´Ùª@| ¨<}$� oB�LÚb� q s��?}�È3�� Û � � � npoqº£�»?¼W½��L¦���¤ ¢

| �&} � ��<� ÈEÅ$ÐØÄL��{LoB©�o��!ÂÓ� � ¨�o�ª1��{ Á � npoHq¹�E|� ©�� � � � � ¸ � ¨�o�npoq�� Ã�Ä�ÄÜÅw�X� � �L¶� t }�3� Á � · � ¯ ¦�¬�¥ ± ¤ ²�£w¥L³µ´Ùª@| ¨6~^� o�} � � �ÎÝ ���Þsz���ÞsOy�� � È� � � o�� ·Mß ¨ÊÓËO£&³�¢ ÌÎÍzÏ · � ��ÐÑ�Hr^�Ç}Ho � �3� Á � r s�t ¸ � ¨�o?~^� o�}�npoq«Ä � Â� }�n�oqpr s�t ~ ¨1�?} � o������ÞsLr s�t Ý È� � � o���È3�� Û � �µ�� � � npoqpr s�t ~ ¨1�W} � o���Ä�o � npoqº£�»?¼?½��L¦���¤ ¢· �O� �1� �?} ¯ ¦�¬�¥ ± ¤ ²�£w¥L³µ´Ù�!|L�b~3�^}

Page 24: Grokking thegimp

à3á â�ã<ä�åwæ ç èOé<êëÆì�í¹íÇî æ�ï�ðpñkò�ó î ô ò íöõO÷µø ù�úOû�îBü ý å<þ!ñ

ÿ�� � ������� �� ������� �� �������������� �"!$#&%&')(����*(+�),�-/.��10 2��4365 78���9����:;�<�= �6��><?+��@>)?+3��AB�C�9-�-EDFBG H ')(4� I<,=)JLK=)M >65N ,Øÿ�� � ������: O G , H '�?4�-� ,<36P<� 7Q H J I G PSRUTV')(��A 2W�F �)�X ?+�<?4���ZY[�6 �0\PN ? J I G �9 ] L, /^, H 5 78�)�9���Çÿ_� � ������>N � H �6 2B?`: M O G ,� �Ya�L?]�Wb 2B� 7c-Lde? M ^, H PSRUTV $7Q 6b� ? H >ZYf-e?4�/: �@>O<,L: �= 0 7 H $7Q �<?4� J 0<>), H �Wb 2*5 78���9����: �@>N ?� S7Q L� 7c-Lde? M : M O G ,g��� 2 J ��?�-1PN ?�^, H 5 78�)�9��� J I G : ���/?�(4�<� J I G �SRh0i'FH : � j 1:;�O G , H 'UY`: � j L,<3N ? H 3= G H �_5� �8b6P_.W�kP�,<360I) $7�� J I G ÿ�� � ������^�, H �l!;#&%l S7Q m�I�nFHao : �\ AN�W����*DFBG H n A��/: � pk-/.B� 2�,<3 A �W 1: �\ A*�ZY[��� 7c-@' 7B0)�<?4��de? M 0 2��43/: ��5SRq I Q �)?4� J 0<>�, H �Wb 2�ÿ�� � �����_'FH : � j �<?4�]P 2N 6��?§ÿ�� � ����� J I G 5 2�, H �<?4�W'�?+�L: �\ A�3� ,<36r9��?_PN ?�^, H 5 78������� J I G : ���/?4(��<�/� 7c-�de? M r��)?��W3 2�,� L��> 7c-/.B��� A ^ 7Q �5�,� L�� ,� 6�/ 2B?s: O G , H '�?+�6t�>^, Hÿ_� � �U�� J I G :;>O<,<�u3 7 H .W�* ] ? M ,g�*'i�W��� J 7Q H �)?����ZYf�/ e0\PN ?�^�, H 5 78���9���N���L�k ,I��\P<� 7Q H $7 G 1: , H 0 7 H $7Q �<?4�]P 2N 6��?�ÿ_� � ����� J I G :SP)3_�Wb 2@')?+�<�*(�-�-C: �6 A3� ,<3v: M O G ,� �Y"�<> 7c-��/?]�Wb 2ND Q Y['FH ,<?�' J YC��� 2W�A 2W�F ��� Y&P)?+�u.k0 2@�=�KI J I G ')(��)?+�L?4��n)�XY[' 7B0\P��4?+���A 2W�F � S7Q � p+PO<,<�<?4����3<�/: �\ A�3� ,)3�^, H ÿ�� � �����_,),<�<�/?J YC��� 2B�<?4��: ^ 2B?].B��� A ÿ_� � �U����W�g0/:;�p]�4�/?4�^F Q w0 A*��?+3�><(�: ,I�3\0/: M = G ��:S5= � J I G �$78�+^ 2�, x4yqx4y z{,I��)�=�KI J I G H ?+3)�)�X ?|PO<,u�)?4�N�Wb 2N�8R}���> 7B0-� �PI�3$~�-@,�� ~�0/: M O G ,:;�I�3<�_��� 28�8�����+�<�����4�\0 H9� �*H �S~qb 7 G �>� ?4�SRh0 J I G : M = G H �Wb 28.��e,I��6P<� 7Q H �8R}��L> 7B0\0 7 H �<>� ?��4� p�PO<,

A-S-f . PZY"� 7 G H I Q ')(�:;�I�3)�L: ,)?§ÿ_� � ������N ,� /�6 2B?�DFBG H P$RUTw: M = G H �Bb 2

� 7c-Lde? MwM � 2�,<� J 7Q H PN ?�^�, H 5 78���9��� J I G :SP)3)�XYf�6 �0_.B� 2W�XYf��� 7c- ÿ�� � �����_, 7c 1:S0= ��0 7 H $7Q w0 2��43<�<?4�N�Bb 2N��R}��L> 7B0/: M I�3 H ziP<� 7Q H PO<,��/���h�Z� �v�u��5)?4�@0 2��43�e�h���U�<PSRUT�')(��)?+�L?4��nu3 2�,� ��<> 7c-@^ 7Q e5�,� m�@�O<, J YfD Q Y ÿ�� � ����� J I G :SP)3_�Wb 28.k0 2 J 7c J I���#[���|��a�Z�4�+�a�6� �\�_� �)�+���a�Z�g� �f�+�+�)�;����������_�[�)�q�)r��_����+���u!�����g� �\��� �<�����_��� �9���f�X� � �����+�a� �Z�|� �hy �

à3á;�Oã<ä�åwæ ç è� ä�åMä é8¡ ý£¢c¤"¥L¦�§\¨N©�ª æ�ñ ¢c¤|«�ùc¨l¬pî ó6­ ý è ¢N®�¯6°�ù�ú�¨

�)?4� J Y"�ZY`: �?gr��)?��k5 7B0v�+><(4�<?4�W�4? H&± �+�4��\�+>�("�)��� �_�+�X� ���s: � j 6�/ FBG H �� ePZY"� 7 G H J 7 G �9.����ZY[��� 7c-²�"!$#&%a�W /�6 S7 H �O<,L:;>N �\ I Q PZY"� 7 G H: �@>N ?� I Q ')(4n A��/:;�I�3<�_�Wb 2N-� ,<3_�� /- J6J I GW³ : � O G ,65 2�, H � I��<?4�*�<�2B? H �/?4�6P;~\�h#[���4´*�8r]- J6J I Gkµ PZY"� 7 G H I Q ')(�: � j /, H P;~�����(4�),�-��ZY&P 7��u�W ��)?��B���*(+�),�-d�? M �U�����&¶g����� �X� �+·)���+><(9�� 6- J/J I Gk¸ �ZYf�@� 7c-e�<?4�1¹�º�»�¼1º)¹�!;»e�½de? M �X¹\��+�<���Z� �4·��

PZY"� 7 G H �XYf�@� 7c-��)?4� J Y"�ZY`: �?gr�5 7B0m�+>�(���? H �<?+�/?4��n��L?].]0 2�'�?+��/ 2B?_5N ? H de? M �+> 2���:;>O<,<�mºg�\� ���m�4�)¶��gr���9��)�)¶���k���l,<3� ? H .*�W� p5)?+�v�<?4�N�Wb 2N�8R}��L> 7B06: M O G ,�� 7 G HkH ?� L'�?+�\PI�3S~�-@,�� ~�0)� p�: � j 1:;�O G , H 'UY`: � j 1�+>�(: � j /���*(9��3gb� h~U,<3N ? H �/?+�u�<?4�*� 7 G H J Y"�XY`: L?l�)?4�/?4��n J YC.k0 28��0)3 J YH ?� J I G �/ 2B?_5N ? H de? M '�?+�� $7Q ��\0�8R}�� �6�@�h�Z� �v���)r��<?4�*� 7 G H 5 7B0s')(�: ��>I G 3� �.B�/�Bb 2N�8R}��v�/���h�Z� �v�i¾i�+>�(+�<?4�*� 7 G H ��� 2��4? H ')(9�Wb 2N�8R}�� �6�@�X�X� �m��¿DFBG H ')( M -/�� /- J6J I G z<r o �+><( ³ �<?4� J Y"�ZY`: �?gr��)?4�]5 7B0m�4><(4�)?4�W��? H : � j /�=�KI J I G �W�g0/:;�p]�4�/?+���ZYf�@� 7c-e�)?���3 2B?+3 ± ���4�����+>�("�<�� ���+�X� ����*(��L�X ? H �/ 2B?_5N ? H de? M ��><?+3�-e?� ½�+><(��*(��/�h ? Hl± �+�+���� 7c-w�1�4��_�+����#[���4´

�8����������� �l!;#&%&' 7B0)�)?������ 2B� I��<?4��: � pk-�^ 2�,<� A*>/: �I G 3��4� 7c-e�<?4� J Y"�XY`: L?r45 7B0m�4><(+�4? H .B� 28�� 6�/ k ��3\P��4?+�/'UYÀ: � O G ,g.���� p+5)?+� J I G � I/PZY"� 7 G H �W� 2J Y"�XY`: L?[���O<,65 7B0gde? M �8���9�+�<���/')(+' 7B0/: � pk-�^ 2�,<� A*>/: �@>N ?� S7Q �: ^ 2B?9.��/�� J I G M 7���^ 2�,<� A*>���> 7��V�X¼@���U�g�g� ��Á/�9�S�����S��� J J I G ^ 2�,<� A*>�DFBG H :SP)3),)3 A �� , �/ 2B?a�<?4�W' 7B0��4? H ��-�- J 7 G ��.��@')(9�Wb 2N^ 2�,<� A*> J I G �����������W��.k0 2]: � pk-/.B� 28�� J I G M 7���^ 2�,<� A*>���:;�I�3)� H ?+3)Âg�X ?�-�7 � : � ,�� ~U��W0)3g.W�* >�- J = Q H ��> 7 H '�?4� J I G �Bb 2N^ 2�,<� A*>_.B�0 7 H $7Q m^ 2�,<� A*>\0 7 H ��>N ?��+ I Q 'FH n A��L:;�I�3)��^F Q ��/?]�Wb 2ND Q Y[Â�.k0 2*5<>�,60s'g ����h ?�')(4� I��<?4��� J J I G ^ 2�,<� A*>g�W /-�7 � : � ,�� ~60 2���3\PZY"� 7 G H J Y"�ZY`: �?f�@�O<,65 7B0_d�? MP<� 7Q H �W���*�PZY"� 7 G H �ZY`: �?`�+>�(g5 7B0gde? M ')(�� J J I G :;>/: 3),�� ~crg�]b) ��9 @>)�L?4�\P$~�@�O<,v:;>/: 3),�� ~Z�/?4�6P$~ J I G �ZY"> 7 H J Y H ?� L,<3 A : ^ 2B?9.��/�� 6-�7 � : � ,�� ~)n 2B? M O Q J I G�<?4��:;>O<,<�<�ZY"> 7 H J Y H ?� /,<3 A �W /�6 2B?_5N ? H de? M �+> 2��a')(4� I�: M I�3 H ��PN M O Q J I G �N �� J I G ,<3 A �W /^,�-C: ^�5)�<?4��:;>O<,<�^�, H :;>/: 3),�� ~ J I G �XY"> 7 H J Y H ?� L,)3 A : J ?� $7Q J I G ')(4n A��/� J J I G : ^ 2B?].B�/�W /-�7 � : � ,<� ~ � �*H�S~qb 7 G ��)?4�W�4? H de? M �9-�- M = :SÃÄ��@>)?+3b� = 0<�)?+�L?4��n/:;>O<,)�g.k0 2*0 2��43<�)?4� J Y H ?� /,<3 A �6 2B?_5N ? H de? M �+> 2���:;>O<,<�mºg�\� ��#[����ln 2B?9de? M �ZY"> 7 H �+�60 HM O Q J I G �)?��9:;>O<,<�V���<�� �_�+�X� ���+�),<3 A � �*H �$~qb 7 G ²%_���k�U�u! ���q�&')(�� J J I G ^ 2�,<� A*>�'�?+��-�7 � : � ,�� ~8: ^ 2B?9.��/�� v�<��� �_���h� ��[ S7Q V��0)3��4? H de? M > H : Å M ?4(g0 2B?� �� /^, H M O Q J I G �)?4��:;>O<,)�`Æ��$de? M ,<?�'')(��+�60 H : � j �<�� ���+�X� ���a,I���, 7c /�6 FBG H ��5N .W�k �+�\0 H �I�n 2B?9de? MeJ I G PSRUTm�XY`: L?4�/?].W�k .k0 2�,<3 A 5<� H � 7c �� 7c-�<��� �_���h� ����� 6de? M �4�W��0 7 H $7Q 6de? M '<(�4�\0 H � p+5N ,L: � O G ,6PSRUTi.k0 2N^)3 7c-/��� 2�d�? M �ZYs: L?].��e,)3 A �� 6-��= : �4TÇ�<�� ���+�X� ��a, 7c 1�+������de? M�J I G PSRUTw: M = G H �4? H'<(4�<?+�/?��WnL:SP<>O G ,� �3 2B?+3g.k0 28��0)3_�Wb 2]:SP<�O G , H � O<,v#f�+¿4�|�ZYf�@� 7c- � �*H �$~qb 7 G ²%g���k���&���l»@���È')(�� J J I G ^ 2�,<� A*>�')?+�-�7 � : � ,�� ~8: ^ 2B?].��/�� /�6 2B?_5N ? H

ÉËÊWÌ8ÍUÎ�ÌhÏgÐWÑ�ÒÓ�Ô Ì8ÕNÖU× ØqÙ9ÍXÌ Ô�Ú Û ÊWÜ4Ý�Þ�Ù ßUà Ñ�Ìcá�á�Þ�â ÊÓ]ã�äå æ$ç â è Ó à é�â êÓ é

Page 25: Grokking thegimp

ë�ì�í�î ïcð�ñ�ò�ó*ô õ öB÷ ó ö)øgð�ì_ùí�î6ùö�ú ïcûLëeì�íeõ öB÷ ü)ý+þ4ì]ÿ������ �Bì+ú�ô î�ð6õ��aú<ì�� ïBù`ò � î������ ðLì9ë�ì�í��������kù ������ î<úëeì�í�� �Nð��9û�û1ù ��þ <ú)ì!���Bì]ÿ#"%$'& $)(+*�, -'.�� ��þ+ü/ ÿ�õ0�aú<ì�� ïBù`ò1� î��2��� ð�ì+3 ïhÿ�ó ö54 6*ÿ+7�8:9 ï ÷ ð7<ìBõ��;�2��� ð�ì<�9û�û�í = ��><?1îö�7�î% Nô ì9ÿ9õ öB÷ ��ö� 57)þXô ì@7<ìBõ0�A�2��� ð�ì�õ öB÷ ó/îgÿB� ò Ckð��kù ���EDF-5GH�I1, J, K5& $L3)ð$ï ÷ ðF�� îM�9õ/ð6õ öB÷ N0OFP�+7%�ó/ü)ý�õ0�;����� ð�ì<� Q)í�ì�ý���R� �î� 8�õ öB÷ 72�;� ïhÿ9õ��Cÿ�ì�ðLî% S ô �TOU ïhÿ�û�ïV4W� 4�î� 8X�)�Nô 4 6*ÿ+7�8:9 ï ÷ ð/ð ö Y�ü)ý�õ��;�2��� ð�ì�õZ��7X���R� �î� 8�õ öB÷ �<ì+ó/ìL[�<ó6îgÿ<� ò Ckð\�kù �]�^�Wó*ô �kù ��O_ ù)�Bþ �`3�ò1� î�� �Bì+ó ö�7<ì!�%�Bì]ÿ"%$'& $)(+*�, -<.��Wþ �U7 C]ü)ýL�2��� ð�ì�ûF= � þ�M�Nô þ�ð/õ öB÷ î% S ô ñWð/øî�û�� ø��57<ìP���� î%7iü�ìa7�õ���7R���X� )î� 8�õ öB÷ �)ì4ó/ìb�<ó6îgÿB� ò Ckð��]ù �F� �Bì�ëeì�íUOF*ý7�î�û1ù ��þ R���X� )î� 8óLìa7%7�þXô ì�ò/ð / ÷ ÿ�î ïcð�ëeì�í������ ðLì+ü)ý'� OF�öB÷ �ð]�cOF�gÿdNb�%Nÿa���Bì9ÿB���X� )î� 8)N�ù5 %Wþ4ó\ëeì�íeõZ��7X���R� �î� 8e� O fð6ëeì�íW�Sùö� )þ7Nô î�ð/õ öB÷ ü)ý'�9õ/ð/õ öB÷ ø ��î<ó S!�X� ø �Bì��TO/ñWðû�ïV4#� 4�î� 8

�2�fò1 ïcû�õ öB÷ íXï07ø ��î<ó S!�ò1� ï07g��h1$aiEj<k)& *�lXkPi^iE$'m�3)ðSïY8ðgNeOFP�+7��óon;p^qsr|óö\*ý�û�û�û�ïV4W� 4�î% 8�õ öB÷ ó ö'9� ÷ îg��t1j'u#$)vwlXkPi^iE$'m�3�� �Bì�òLìa7x�����o� ��îgÿ7<ìBõ��;�2��� ð�ìByL� ïBù`ò � î)þ4ì]ÿ9ëeì�í²ü��fðLþ�ðLóLìa7R�a� ��þA7)ì�� ïY�ÿc9� ÷ îgñWò �T7 ïcû@û�ïV4W� 4�î� 8�ðSïY8ð/ü)ýP9�ô þ gñ�ðR7<ìBõ0��ÿ�ì�ð\ñWò �Bó ö5O]�ýL�=)õRz=�ëeì�í1ó/ìa7�ø/ Y8ð

ëeì�íeõ öB÷{|:{!}w�a�\ù_ÿ)� ï8þ+î% Nô ì]ÿa7)ìNñ[9 �8ÿ+ì�ð6û�ïV4#� 4�î� 8�õ öB÷ ó ö'9� ÷ î`ëeì�í�õ öB÷L{a|E{b}%�EjL3 �a�\ù_ÿ�í � Y8ð6õ öB÷ 7<ìP���� î%7%STO@þ�ÿ+7��)ó\~/ ÷ ÿ<�9õ/ð6õ öB÷ � ø �Bì��`O/ñ�ðû�ïV4#� 4�î� 8�õ öB÷ ó ö'9� ÷ î6ù ��þ \�2�A� ï ÷ ÿ@DU-5GLH�t1j<u@$)v�~/ ÷ ÿa�<ì+ó/ìb��íeûX�]ù ��� ó � ÷ îx������õ��Cÿ�ì�ð/õ öB÷ ò6ð �Bì)�Nô ì]ÿ]ëeì�íW�a� ��þ'���� î%7X� ó6ð SW�)vx, *'7)ìLNñT9 ��4 6*ÿ+7�8:9 ï ÷ ð6ð ö Y�� í � ÷ î_ñ�ò �*ý�û�û��a�6ù_ÿd�kù�î�ýL� C]î%7�ø/ Y8ð�ó/ì_ù ïhÿ]ë�ì�íeõ öB÷{|:{!}5��K)3\�2�[ò ïcûF*ý�ûe��9� ÷ î�øîgÿ9û�ïV4#� 4�î� 8��_ÿ��`Ovëeì�íeõ öB÷L{a|E{b}%�E(L3 �a�<ý)��v'3 �a�\ù_ÿa�/ ÿa7)ìNñ[9 �FDU-5GLHt1j'u@$Lv|ñ�ð 7)ì�� ïY�ÿc9� ÷ î�û�ïV4W� 4�î� 8Uîö�7x�5 ïY�ÿ�N�ù5 _ñ[9 �09� ÷ îgñ�òLókô �2�fò1 ïcû�í � Y8ð/õ öB÷ 7<ìP���� î%7�STOF�öB÷ � ò1�öB÷ <ó

7)ìWþ4ì9ÿdN�ù5 _ñ[9 �Nø ��î<ó S!�)ü�ìa7�û�ïV4W� 4�î� 8�õ öB÷ ó ö'9� ÷ îsõ����kù �eN�ù5 _ñ[9 �!�2�;� ï ÷ ÿ�r)jLJd*�$�t1j<u@$)v�~/ ÷ ÿ�î% S ô ñWð�� ó\ð S��Bvx, *x� òLó � îð 7 ïcð

���[�e���0���B�[�b��b� �e����� �:�c��� �P� � �[�� �`� � � � �`�0� �:�d� ��� �E  �`¡ � ��� ��� ���¢ �� � ��� ��� ¡ £ ��� ¤�!�`�P� �   �V�

Page 26: Grokking thegimp

¥U¦P§U¨ ©Tª«¬:«c­�®a¯\°)±a²³ ±�´d°'µ�¶· ¸�µ%¹<¨ ©Tª º5¶'®a¯\°)±<» ¼ ½Tª µ%¼ ©�¹%¦¾�¿[À Á!Â2Ã;¯ Ä ª ±�ÅBÆÇ�ÈEÉ�Ê1Æ'Ë@ÉLÌ�ͳ ª ±¾!¶+Î Î1º5¶+¨0Ã;¹5¦¾[Ϧ�±PÐ Á`µ%¼ Ñ!·'¨ ©Tª µ%Ò Ñ Ó ¿[ÔXÎEÄVÕW» Õ]µ%¾ ÖE¨ ©Tª¼ ©'À½Tª µM» ¼ ½Tª µ5¼ ©�¹5¦L¾dÂ%·× Ø ¹<¨ ©Tª À½Tª µ'¨ ©Tª Ù Á`µB±a¹5¦¾�¿bÔ�´�°'µ%¶L· ¸�µ5¹wÙ5¦a¼U° Á`ÏÒ5¹%¦¾�Â%·× Ø ¹'¨ ©Tª Ú0ÛÜE¼ÝÅBÆLÇdÈEÉ;ÔRµ%¹'º5¦a¹<Ô © ÞXß ¦a¹xÂ^Û�àáÙ Á`µB±+¹%¦¾!·<ÎRÀ½Tª µB¿bÔ�´�°'µ%¶L· ¸�µ5¹¯%¦a¼X¦L¾[²'¨�Ã�´d° Áeâ[°5ÒxÂ%·× Ø ¹'¨ ©Tª À½Tª µ)¿bß ÁT¼ ©<´dãP´!·<¨�Öe®a¯\°)±�®a· Á`Ï<Â5·× Ø ¹<ÚeÛÜE¼Ýä1É'å ÉaÈEÉ

æ%ç�è éeêáë:ì í î5ï;ð1ñ ðóò�ô]õ\õ öo÷sø1ù#ú1û�üTûAûWýWîcþ1ÿ�û�� ò�������� ��� ÷

Õ �!±+¹� :À Ä ª ÔXÐ'Ò5¦Ò ®·%¶¼�Û�¼R¼xµB±d¿bß ¼!Óa» Ú �<ÔFÂ2Ã;¯ Ä ª ±P¨ ©Tª ¼ ©5ÚF¾!¶câVÀ5Ô� 2¼R¦a¹ ¯2ÃWß1¾ ÄVÎU¹5¦¾T¨�Ã�±+¦+Ô]®cÎ Î�Å�� �É'å �2Ç��)Æ<å É�¹ ÄVÎR¥U¦P§ ͳ ª ±)Ù Á`µ)±a¹5¦L¾dÂ'ÏL¦a¼®a¼!Ó Ô Ò2à ·%¶'» µ©�Ò\° ®·%¶BÂ5¼�À ÄT°�¿[Ô ¹5¦L¾Tº ÄT°5¹5¦¾b¹ ÄVÎF¾b¦aÒ%·�¶'» µ©�Òx°\Ù�Ó ¦�±��BÐ<µB±�¥U¦P§

��� �������! #"%$ & ')(+*-,-*/.�021�34065�587 9�5�:<;>= ?�@�5�A�B

Page 27: Grokking thegimp

CED�FHGJIKGMLONJP-Q)RTS UWVJXZY\[ D]R�^ZD�_a`cb dWR�D�e2f�ghP U i R�jkY�D�Y#f�lnmoP�DJp6D�_rq�sutv XZ^)`wb dWxMQ dWyrQ�Y8fZtz { ^�| }ci _~c��N�V�[ e�jkY�DJY#�����T�8��� �%��� �J�O��� ��������| }ci^�ta[ X�R�s�f�_v i X�RJp v X�� ��R�^���b U i e-e } �W�2_���^kXk��x\��Q d\V�Y���y���p�Q��6  z �KUcSz ^ZD�_�y��6pEQ�NJ_r^)`wb dWRJD�eEQ d\V�YZ^�DT_]f�tz { ^8f dcD]R]¡cV d¢NJt d\VTtZDJ^8fZt�lnp8�2_z s V�m#| }ci S d\X�R�^ZD�_`re��-e dcD)Sa[ D]R]C2D�F£s p v i Xk�2ta[ XZY���l¤Kp2s p dcDTP%��CED�FE�¥_z s VTmO| }ci S d\X)RJ^�DT_c¦Z�Jq ~r^kjkY�DJY�CED�FE| }ci�G�I�G]L��n����NJP-Q)R��2_z s V�m#| }ci S d\X�R�^ZD�_w¦���jkYZDJY�| }ci ^�g+�-e2Q8Q d\V�Ys p dcD�P%�6NJtZ��CED�FHG�I�G]L���§��6N�P8Q)RM`r� da|�_rD���V�[ D��2_z s V�mO| }ci sutv XZ^Zq ~r^kjkY�D�Yk¦�e�s�S ¨�p8��e dcD)Sa[ D�R]CED�F�¡MQ d\X�Y\[ D]R]¡r_Ee }ci fv XkVz�©}�| }ci PZ��QkV�^�P�g+��_ Uª�E^�DT_\j�Y�DJYC2D�F+s «�F�D����2_z s V�mO| }ci su_rD)S d\X�R�^ZD�_

yW��p�Q�| }ci PkX�R�jkX)R�s�fZ_v i X�R�p v XkjkYZDJY#��¬ ~rp-��fv X�^ZD�_]fZtz { ^ © _�_wpEQ�D+��_v X­^8Q��Wl¤Kp¯®-°8±�� �%²n³o´¯fZtz { ^�s p dcD�P%�K| }ci �-e dcD)Sa[ D]R�CED�Fµ^ZD�_]fZtz { ^6NTSa[ tZ�fZ_ U��R�¦��ks � ¶�e6^ZD�_cjkYZDJY�CED�FE|%Uªe�| }�e6X�^�¦kDJ^ke } �6�-e dcD)Sa[ D]R�CED�F¥Y U!RJP�D�p�D�_rqZq ~r^kjkY�D�Y�s j dcD�·ZXkXZ^�¡MQ d�Q d\V�Y���l¤Kp6t UcQ���e2f}�Y%�K��X�_ ��Q�j�X�R)f%lnm¸yrQ�Y)`r� da|�gRJD�e6X�Y ~ [ | }ci �-e dcD)Sa[ D]R]CED�F£NJt d\V�^ZD�_r^8Q��Wl¤Kp¯¹o�ªs�fZ_v i X�R��6p6DJY�s |][ DJ^ Uª���6s F v i XkjkY�D�Y�s j dcDº�%CED�F�`w��»¥[ j¼ �We���NJtZ��^-Q��Wl¤Kp½·8�ªs�f�_v i X�R��6p6DJYZtk���6s p v i XS d\X�RJ^�D�_cjkYZDJY�XkXZ^#��CED�F+sut ¨�^�t)R���p }�j d\X�P U!R�s ^8SkV�[ D�s�fZ_v i X)R��6p6DJYO¹Oe�U�WeoXZY ~ [ | }ci �Wl¤Kp2s�Q}�Y�V�^ Uªe�^ Uª��s�fZ_v i X�R��6p6DJYO´¾s F v i X�s � ¶�e�^ZD�_w¦ng�¡MQ dWRn[ D�Y�j¼ �WeoV�[ D�Wl¤Kp-e } �ap }�¡cV dwP�g+��_ Uª����VT^�CED�F¿��_v X�j�Y�DJY�`r�6»�[ j¼ �We#`we�jkmo��| }ci s�fZ_v i X�R���p�DJY�·�e%U�We�NJP-QTR]`r� da|�_rD���V�[ D��Wl¤Kp-e } �ap }�¡cV d]s F v i X-S UcQkX�XZ^���_v X�t8Q�j�e�D)Q�CED�Fe�U i e�s X)R+j d\X-Q}�j�X�RJ^�D�_a`wb da�Wl¤Kp�t UcQ���eEf}�Y��K��X�_ ��Q8fv X<f�lnm�¡wpM[ ¦ngÀs � ¶�e2S d\X)R)fZtz { ^6sutv XZ^�s�fZ_v i X�RJp v Xk¬ ~rp-¦�DJ^�^�ta[ X�R�s�fZ_v i X�RJp v X6sut�Y

� ��R�^���b U i e¯°8±)Á�� ��Â�Ã4ÁK��ĺ¬¼ i R�FE��¡]Q d]s p v i X-f�lnmO|ag�R�D�e6XZY ~ [ | }ci ��e dcD)Sa[ D]R�CED�FÅNJt d\Vksutv XZ^�s p-e ~�Æ�� Ç�È/^ ¨Ts � ¶�e�X}�^�Vz�©}�| }ci PZDJp�D�_rqk�2_ Uª��s �2t}ci Ykej�e6D)Q�j�X�R��-e dcD)Sa[ D]R�s F v i X�`w� dc^Z_wXk����e dcD�Sa[ D]R�p }�j�e6D)Q�F¥X-Q}�^ Uª�6CED�FÅNTSa[ ¡wpM[ s ^z e�j�e�D)Q��-e dcD�¦�XZp-Xke z s�SkX�_ �KjkX)R�|][ D�e¿fngÉP U i R�°�±�Á�� �)ÂEÃ4ÁK��ÄÀp }��Wl¤Kpt UcQ8fv XO®-Ê�²�Á�� ³½´½Ç­s p v i Xk|�g¢R�D�e6XZY ~ [ | }ci �-e dcD)Sa[ D]R]C2D�F

s p v i X�¡r_r^ ¨JS�D�p8| }ci |!ln^�Pa[ V�e�j�X�R]CED�FE| }ci j�Y�DJY�¡wp�[ PZDJp�DT_wqZp-X�R�s � ¨Me8¡MQ da|%U��R���p�Q)`re-��e dcD)Sa[ D]R�CED�FÅË Ì��)��Ç�Í����T��ÇkÁk��_rDJYZt��ks X}�Y-Q)`re-��UWV�j d\XG�I�G�I �)�8P�DJp6D�_rq)`wb dwP�g+��_ Uª�E^ZD�_]Q ~\CED�FE|�U��R���p�Q)¡MQ d2Y U!RJp }ZX}�^­ÎÉVz�©}8P�g+��_ Uª�E^�DT_]Q ~\C2D�FE|�U��R���p�Q�j�X�R]CED�FE| }ci q ~r^kjkY�D�Y�NJt d\V�e�U i eEfv XZ^ZD�_a`cb dE°ZÏ�Ð�� �§��kÁ��¢| }ci X�Y ~ [ Q dcD�e�j dcD]R�jkX)R��-e dcD)Sa[ D]R�CED�FÅNTSa[ XZD�¦�¦���¡wp�[ `wb\[ Vz�©}�| }ci PZ��QkV�^k| }ci P�l!Q�Vz�©}�| }ci P�X�RTfv XZ^�DT_]f�tz { ^��Wl¤Kp6^ZtZD]R�jkX)R�s p dcD�P��WNJtZ�TtZDJ^)`re��-e dcD)Sa[ D]RC2D�F¿Vz�©}�e } ��`wb dW¡MQ d�Q}�q dcD�C2D�F�S d\X�R�^ZD�_rq ~r^k�2_ Uª��jkYZDJY�s |][ D�e�U�We¯q dcD���DJ^-f�lnm#¦ngÀs � ¶�e2S d\X�RTQ ~\CED�F�`we�_~c��N�����Sa[ D]RJ^ Uªeo¦kD�^���t�DJY�Pa[ V�e�j�X�R]CED�FE| }ci q ~r^j�Y�DJY6NJt d\VÀÑ���Ò�� �Z��²!� Ðk�¢Ã4� ��ÓkÐJÈÔXZD�¦-s � ¶�e6Vz�©}�| }ci P���QkV�^�| }ci P�l!Q

Page 28: Grokking thegimp

Õ�Ö�×aØwÙ ÚWÛJÖ�ÜÞÝ�ß�à�á âZß�ã!á äkå¢æ4á å�çkäJèêéëcì Û�íuîïZð Õ)ñ]ò Ú]í ó ïcì ðkô�õ ÛJÖ�Ü ô öcì ÷ Ü ÚcÖ�ø�ù Ö�Û]úEÖ�ûýüJî Ú\þkíuîïZð Õ6í ó8Ü ÿ���á ��è í � ��ÜEò �!Û�úEÖ�û ô öcì������

úEÖ�û ô öcì������ ü �8ò)Û�úEÖ�û ô öcì � ÿrÕ����ZÖ ��í � ��Ü�������� üJî���úEÖ�û ô öcì�� ������ ��! ü �8ò)Û]ñMò ð ��î " ð Õ�� ð ÛºÝ�ß�à�á âZß�ã!á äkå¢æ4á å�çkäJèêéëcì Û�ü �8ò)Û�úEÖ�ûô �# Û ÷ ó�ò%$'&)(*��Ö�ó�Ö�× � íuîïZð Õ8ò ÿ+�\ù þ�Ü ô öcì ø Ú ð Û�ÕZÖ�×,� ð Û]úEÖ�û�ØwÜ ÷ Ü ÚcÖ)øaù Ö]Û�úEÖ�û.-wò/�0$Zî1 2 Õ6üJî��TîZÖJÕ�Õ�× ð�3 �öcì í ÷ îöcì ��ó ô öcì �¥×wÖ�Õ�4�ØrÜ8ñMò ð �Tî " ð Õ�Ü ö #Ý�ßJà)á â�ß 5�á äkå¢æ4á å�ç�ä�è6��ÖJó�ÖT× � $kþ 3 $'&nó6Õ�Ö�×,���ZÖ �6í � ÚcÖ87 ð�ð Õ)ñMò Ú¢í ó ïcì ð Õ8ò��9&:Kó¥í'$Z×ïcì ð Û ÷ ó6Ö � 3 þ�Õ ÷ ×ïZð î 3 ØrÜ8ñMò ð �Tî " ð Õ

;�< =>< ?>@BADCFE G H�I9JKILINMOHQP>RSIUTWV9XZY�[]\8^ Y�[`_

í ó ïcì ð ó ö ÕZÖ�× ô�õ Û�Ö�Ü�Õ � 3 ×rÖ ��î��kí ðö �-ò ô öcì í � ��Ü�û 1 Õ6í éZî 3 Ü-úEÖ�û ô öcì ���ZÖ ��Ü'�# ܯÕ�ÖT×�í ÷ "MÜ-úEÖ�û�ØrÜ0��Ü6Ö)ò��EÕ-ø1 ña��ò Ú\þ��/bë Û�ó ö �2×+��-K��ÙkÜ c ð �\ù Ö]Û�ó6ÖJÕô öcì b/� ôaõ Ø ÷ Ú ô ×wÖ 3d�ë Û��1 ì Û ô öcì í Õ1 ò��ë # Ü6Õ � 3 úEÖ�û ÷ î �!ÛUbkÖJÕ ô öcì �2× � 3 Ø ÷ Ú]í � ��Ü0��Ü6Ö)ò��EÕ-ø1 üJîW�JÕZÖ�×aØwÙ Ú+$ õ � � ì Ûe���ZÖ ��í � ÚcÖf7 ðkð Õ 3 ù ð ��g�Õ "rñwóMù $aù ð �W����òkþ�ÕkÜF��ÕhjiFkjl bë Û�ó ö/m n Û�Õ'c�Ù � ì Ü�ó &nó�ó ð ÛMØ ÷ óMù � Ýo��èp��á ��è ! í û ïcì ð ü�Õ ÚWña��� neq#÷ Ö)ò �!Û�Õ�îaù Ö�þr$'&)(*�ZÖJó�Ö�× � íuîïZð Õ�ñMò Ú]í ó ïcì ð $'&)( ôaõ ÛJÖ�Ü ð � ÿ ù ô öcì ÷ Ü ÚcÖ�ø�ù Ö�Û]úEÖ�ûÅüJî Ú\þíuîïZð Õ�í ó-Ü ÿ���á ��è m n ÛJÕFc�Ù � ì Ü-Ü ö # b/���Z×ÚcÖ]Û ÷ Ü ÚcÖ]ÛTøaù Ö]Û�úEÖ�û ð �ªÜ8Ø ÷ óMùréëcì Û�í � ��Ü8úEÖ�û�í�òö �kþ�Õ �ªÜ6Õ � 3 úEÖ�û�í�ò1 ós� ð Û�$'&)( ò �!Û�Ü'�# Ü í ó ïcì ð ó ö Õ�Ö�×aØwÙ Ú+$ õ � � ì ÛMØ�ò�g�ØwÜú2Ö�û ÷ Ü ëcì Ût$kþ�ÖJó¥í �2îöcì �kÜ-Ü'�# Ü6Õ "�b/�kü �8ò)Û ô öcì ðö Õ�úEÖ�û ÷ Ü ëcì Û)ò Ú\þ��u��Õ6í þ ÚaÜ�Õ�Ö�×aØwÙ Ú+$ õ � � ì Û����ZÖ � ô öcì ñwóMù ó öwv î�× ù þ�ó�Õ �ªÜ í û�×rÖ�� xs��Ü'�# Ü í ó ïcì ð $'&)(�ØwÙ Ú m n ÛJÕFc�Ù � ì ÜóB&nó�ó ð Û]Ø ÷ óMùJüJî Ú\þ�� � ì Û��/��Ö ��úEÖ�û ÷ Ü ëcì Û�üJî Ú\þ ðö Õ�úEÖ�û ÷ Ü ëcì ÛUb/��� �!Û�$)Û�ó ö ��Ü6Ö)ò��EÕ-ø1

Page 29: Grokking thegimp

ydze{}| ~�|��u� �0���U��z��,����� ze�>������� �+� �F�� � � ���o�U�p�o� �U��ydze{d� �,��|�~|��������w���s����ydzU{d����z ���������  ¡�W���D¢¡�0��£�¤U� �,� yd¥U{6|�~|�¦�� §�����s����yd¥U{L¨'��W��©�� �ª�N��«K¬ ­¯®+¬ �/�/¥ �%� �B��y°¥e{d� �,��|�~|�¦��)���W® �W��¥��e¨'«± ®w�������� ���Q­a²>¢¡������/³o����� �  ¡�W���°� ´a©���{'  ¬ � �ª�%yd¥U{d� �,��| ~�|�¦�� §���� �s������������e� �,�¨'«± ®�����­a²�¨ �a¬ ��� �ª����«K¬ ���   ¬ ¢¡�0yd¥e{d� �,� ® �/���w¥���²d�0«± ® �/� ´a�sµ�©��,¶·�8© ¬ ¥t« �9©/¨ ����������yd¥e{L� �W¤�® ¸)®>®>����� �,� � �s���e³��W­Q«>¨'«± ¹ ��³d¥�� ��������yd¥e{°� �,��| ~�|�¦����������¤t� §��>µº �¼»�½/~ ¾t� �ª³�»�½�~|Z¿À � ��� �s���U© ¬ ¥eÁ>� ´,¥�«K¬ ¥��e�F�¹ ��������� �s���U®B¸)®>®>����� �,�Q¾u� ��¤u|Z������yd¥e{°� �,�Q»�½

ÂWÃÅÄdÃÅÆsÇ>È`ÈtÉ Ê ËoÌ8Í9ÎtÏÐÒÑÔÓ ÕZÖ�×ÙØ8×wÚ ÛÝÜNÞ/ß�àB×wá.â

ã ²°�e�UäW�¡®æåjçÅètéê®�/³°�¡¥U©�¨ ¿/��� � �+¤U³�³wëa¬ ©��>¨ Áo�º �ì��¥ ®>¥��¡íw¨Å��W�/ä0�  K­Q� ´a¶�¥ ä�ä��a¬ ����¨'µ��º � ��� ® º ��¨Å�º ��äsµ·�S� � � �jîo��ï ðtÁo�º � ã �/��äs��²9¸ñ�®�ò�|O¢¯��/£*¤Uó �,� ¨ ® ´,¥��F�)���   ¬ ¢¡�0Á>� ´,¥�«K¬ ¥�� ä/¥��,ó���� ¥e�>� �ª�s¢e��� �ª�>Á0� À � ������� ã ²°�e�Uä��¡®æåjçÅèté

Page 30: Grokking thegimp

ôdõeöd÷ ø,ù�ú�ûú�üuý þsÿ������ �,õ��� õ���� ������¡õ���� �� �� ����� ����� � �! #"�õ$�%"sÿ'&)(*,+.-�ú/� + ! ù 0� + �,õ�þ1���ø 23 4� 5 � ÷ ø,ù �764�! ù ���+ ! '�8� 9>ÿ'��� :,ù ���' ��<;3&��eý�"4�%+=�?>��@��A� �$��� � �! 8B8>�C%� �� �� 8+ 5?����� ����� � �! �÷ø,ù � "ø,ù ���D� �� ���" EF�G�764�! ù ��D+ ! '��� 9>ÿ'�1E2)�H& I�õD�#J�K�L�MON�L�M�Pêý$�4>RQ L$S4N�TU� & V'�0�9�Wø'C%�0"�õ$��� � �,õ�ÿ 5?�¡õD���4>�� ø��sÿ� ! ù �0X�� ���� �� 4+ 5?��÷1E2Y���0+dÿ�CZ� �?>��@�0��� �$�0� �@�!

[�\][�^ \ _ `�acbed�fhg ikj�l�_nm oqpsr3t.uvd wqf x�i1y{z|z�} ~��

�dõ��64� E2Y�;)&��eý�"��%+=�eQ1���ìý þsÿ���þ9,ù ��÷ ø,ù ÿ 5�� �0+ ! ��@� E3"'����>U÷ ø,ù �Z+<� þ/õD+wõ$�%��B4>� 4W98�dõD���Qÿ �°þ9,ù ��� ø 2Y�Z+?� ��A� �A��� EKþR�@�! �� �� ��9>ÿ�ö��/õ�ÿ*ý��� � & V'�6���õ$+�� � �,õC?B��9>ÿ�� "ø,ù �8�$" EF� �9�Wø'CZ� �v�eQ1���qCZ� �A� 5%"�� �� ��<�Qÿ �� 4��� õ�<�%�Zþ���� � EF�G� �s�7(Y���'� ø 2���÷>÷ ø,ù�ú��:'���o÷0÷ ø,ù<�/B:'�D+ ø8�7E)��� �� Wþ7(Bÿ�÷ �,õD��÷ ø,ù þ����@� EF�@& �����wõe÷7E ù ��A&�÷ø,ù �õ�B�ö��=�:,ù ��B8>D 4W98�°õD��C%� �5A&�6��e�/õD+0÷ø,ù ö��@��� 4�|� �! {-�v���]-���N����DN'L�M]�  ��sP$¡<N�S¢���$N�P<M]£ K'LDP�¤

¥§¦ EF���Qÿ �� &¨ ÿ�ôdõeö CZ��;3&��eý�"4�%+=�/Qk���ìýD��>�� �� ��D"/õ$�,÷ ø,ù B8>�CA� �&�� E© "8 98��ª¨ �0�7�� 4� ��" EF�wôdõeö6ý��� �Z+<� þ/õD+wõ$�%��÷�G�Qÿ �G� ö��¡õ$>'�'�� 8 4"4+>õD"��/õD�0� & V'�þø@� ÷�õe÷7E2Y���@+oÿU+ ø4 �>�?���9>ÿ�ö��/õ�ÿ8" EF��;3&��eý�"��Z+=�/Qk���/�' �� ¦ EF���@�! ��Z+<� «

�� '� �Z+<� + ø4 �>��%���9>ÿ�ö��/õ�ÿ�÷7E2Y� þ9 2)�H�dõ���÷ ø�61(O�{ �õ�B'B8>�;3�@�0ÿ�ôdõeöLý�� �¬Q L$S4N�T�N�S��]� E)�D 4�� õ���� ��� ����ª��1�ôdõeöLý��@���/Q -�¤wý$�4>�&�� E© "8 98�þ�� ����C%�@�v� �' ��e�/Qk���q�Z+<� ÷3�G� õ��@� � ��+�" EF��ôdõeöLý��@�­Q L$S4N�T�N�SU�9�Wø�ýD" �& �����wõD" ®D6! �C%� �?67(O�¯� &��ø,ù ���sôdõUö@��& 4� 5 � CZ��;3�0+dÿ�°���±�:,ù ��þ/õD+wõ$�%��ö����Qÿ �� + ! ù �67(O�ì÷�G� õ��� 4� 5 � ÷ ø,ù ��� �,õ��� õ��ôdõeö6ýD� �����k�! 4"0� +�� 5�Q ²q³�´8N�µ.��K�S4N�µ¶°��q±

¥ � � Eh��B/õD"�÷ ø,ù ¦ EF�oþ4��,õ��ôdõeö��k�ø�������� 8�wýD� ����;¡ÿ8��CZ� ��k��� �8 �� �F·�+wõ�þ�61�wýD�4>UöOõDWe�@��õD�� EF� ¦ EF���Qÿ �� " ®<�wôdõeö¬�,¸4³�¹$N�¤0� � �,õ���ª��1�wý��� �]� õeö� 4+wõ� &¨ ÿsÿ 5Z ø�"�64� E2Y�q+ ø8� �/õD�8 4�� õ�e÷ ø,ù ¦ EF��þ���,õ�<�A� ��wõD����&­� "9>ÿ� �>��%�A�: 2)��� �! 8«

�� '� ��ª��1����� 9>ÿ�º�JG-��' ��q�/Q1�/�`þ�õD+>õ��Z��CZ� �� " ®ù ��� E3"��Zõ�ôdõeö°÷ ø,ù + ø@�k��� �8 �� �F·�+>õ�þ�61�>ýD��>UöOõDW��Qÿ �v�Bÿ 5?�¡õD�4��>'� ø��0ÿ�÷ ø,ù �7E)��� �� æú�û »�¤�ýD�4>� Eh��� & V'����ª��7����� 9>ÿ��'ÿø��8�U÷ ø,ù þ/õD+>õ��%�4� E3"��Zõ�þ8��õ��@>��' ����9 2)���Uõ����' ���67(O� ý��� � �,õ��wõD"�67(O�U��ÿ �¯þ���,õ��ôdõUö��Åþ4�®B/þ4+�� 5?�%�8� ÿø�ýD� ���|67(O� �õ�B�� �� ��D"/õ$��� " ®<��� E3"'�Zõ�Aª��1�7C%� � E3"����H>D ! ù �¼� ��� �Oý��@�=½��8¾'�e·D�eQ1�8·��8¿s�c� & V'�s� ��.þ]���@� EF�s"�õ$��� " ®<�G� � �,õ��ª��7�9ý��@� ! ù ���1E2)�67(O�{BO�|� & V'�0B8>�� �� ��$�Z�$+WôdõUö@;¡ÿ��H��N���´4N|� ÿ 5?�¡õD���4>�� ø��sÿ�÷ ø,ù �1E)�D� �� U»�û À/ûú¤�� �! {-�� ³�M7M,N'L�� ÿ 5?�¡õD���4>�� ø��sÿ�÷ ø,ù �1E)��� �� U»/û À�û »�¤"�� ��OýD� ���DB:'�'� &v�ø,ù �'����&G� " ®<�wôdõeö �A� �)C%����ª��1����� 9>ÿ�CZ�@+?� ��ÿ �

Page 31: Grokking thegimp

Á=Â= Ã'ÄvÅÇÆ�Â=Á=Â�È�ÉËÊ�ÌÍ Ä1ÎUÏ�ÊÐ=Ê%Ñ�Î�Ì Ò=Ó%Ô0Õ Ö@×�ØAÙ

Ú)Û�Ü�Ý�Þ�Ü%ß=à/ákâ�ã¢ä Û å'ævä7ç4ÜèAé ê�ë ß è4ê�ì�í�î Ü ïFðsÞ8ñ$Ü ì Ü òAñ ë ÜóAÛ0ôsñ�õ�ö�ñDÞ�õ ÷�Þ0ä ø4ùHÝ�úû ü òAñ ì]í�î Ü ïFðsÞ4ñ$Ü ì Ü òAñ ë ôsñ�õ�Ý�ð@ð�ý÷4ö÷�ú ê ù|õ ÷�Þ�ä ø4ù4Þ4ù ïFð�þZß?ûþý ò�ÿ÷����� �Aé ì�� ý�ÿ$Þ � �Aé ì � ýHÝDù � þ%ß?û þ<ý òä Û å'æ ì û ÿ�æ�Û�Ü � Þ ê ð ì]í ç ï� � �Aé ö ��3í�ë ñ�æ�ý ï ë Þ�ùû ñ�ÿ�ý ò�ÿ��0äkù���ú ò ê�ë �8Þ�ç�ÿ$ñDß ý�� %î òAÞ ïFðGäkù�ä � ê Ü ��������������0ä õ�ÜZñ � ü òAñäkÜ� � ë ù í ý ïFð�ú8ñDß ê�ë ç��,ÛvÜ � Þ ê ð�� ê�ë Þ4ñ$Ü �3í�ë ñ�æ�ÝDù ò�ÿqõ ÷�Þ0ä ø4ù�ä Û å'æ�ä õ � � ëDì û ÿDæ�Û�Ü � Þ ê ð@õ è � æ���ñ�æ�� ê�ë äkù�ä � ê Ü �8ö�ñDÞ�æ1ï� æ¼äkù�ä � ê Ü �Oö � ü ó%Þ0äkÜ� � ë ø ò ê æÞ ïFæ ê� Þ � � ä õ èAé ê�ì Ü òAñ ë ä Û å'æ�ô�ñ�õ.õ ÷�Þ�ä ø4ù�æ1ï� æ�ä Û å'æ î æû ÿ���äkù �Þ"! �3í# Zî òAÞ8ñ�Ü �íGë ñ�æ0Þ ïFð@õ ÷�Þ0ä ø4ù�ä Û å'æ�äkÜèAé ê�ë çû ê æ�� òAñ ë ù í ðsñDÞ�ÝDù � ç ë ä Û å'æväkÜèAé ê�ë �4ñDÞ�ú ò ê�ëì Ü òAñ ë ôsñ�õvÞ ïFæ�Ý�ð@ð@õ ÷�Þ�ä ø4ù�úû ê õ ÷�Þ�ä ø4ù#Þ4ñ$Ü �3í�ë ñ�æ@Þ ïFð0ôsñ�õ � ï�Yë�î ßsý8Þ %þ%ß?û ì�� ý�ÿ$Þ�æ1ï3Þ#ü òAñDß ��ì û ÿ�æ�Û�Ü � Þ ê ð@ðsñ ë ö � ý�� ê�ë ôsñ�õ � �Aé ú ò ê�ë Þ8ñ$ÜZö ïAý8Þ4ñ$ÜÚ%ý���þZß?û %î òAÞ�Ü �� ðsÞ ïFð ì û ÿDæ êèAé æ$!|Þ4ñ$Ü ì Ü òAñ ë ôsñ�õ�ö�ñDÞ0äkù�ä � ê Ü � �í% Zî ò?ç �'& ì ñDß�ñ$Ü%ü �3í�ë ñ�æ@Þ ïFð ì û ÿ�æ � �Aé ú ò ê�ë Þ4ñ$Ü ê �û ñ ë�ê÷ ì Ü � ö�ñDÞ ì û ÿ�æ � �Aé ä î ùè4êÝ$ù � æ �Aé �í% %î òäkù0ä � ê Ü �)ä Û å'æ ìèAé ê Þ4ù4ñ ë(� �Aé ä î ß�ñ ��ì ß � �Aé ì � ý æ@Þ8ñ�Ü �íGë ñ�æ�ö8ñDÞ'õ ÷�Þ�ä ø4ù�þ�Û ì ó û ôsñ�õÚZý���ÛsÞ�ú÷�ôsñ�õ � �Aé äkÜ%ñ�ú ò ê�ë Þ8ñ$Ü ì Ü òAñ ë ö � ü ó%Þ ì Ü òAñ ë Ú%ý���ç�ÿ$ñDßsç÷�ý î ù4ñ���Ý�ð@ð¶ö�ñDÞ î ù4ñ��'ôsñ�õ ê ñ�ö�ä Û å'æ�ðsñ ëDì û ÿDæ�ö�ñDÞ � �Aé æ �Aé)� �Aé æ7ï é æ � �Aé äkÜ%ñÛ � ú÷�ý'Û � úû ê ä Û å'æ�ô�ñ�õ�ä7ý� ��ÿUäkù�ä � ê Ü � ê æ � �{ñ�ú Zî òäkÜ%ñ$ÜZÿ$ß � � Þ�ô�ñ�õ@þ<ý òGÝ�úû � ï ë ç ë Ý�4Þ+*÷ � æ@Þ ïFæ ê � ó û<ÿ÷��� Û � ú÷�ý�ô�ñ�õ æ0Þ4ñ$Ü �íGë ñ�æ@Þ ïFð0ô�ñ�õGý÷4ö÷�ú ê ùæ � � ß � Û�Ü � Ú,�+*8æ-� ê ��û ñ ë(� �Aé ì � ý�ç �'& ì ñDß0ñ$Ü%ü �íGë ñ�æ0Þ ïFð$*÷ � æ ë ñ�æ�ä õ � � ëDì û ÿDævä7ý� �8ÿ�ÚZý���Û�Ü%ñ/.�ö�ñDÞ10'ù4Þ4Ü �� ðsÞ ïFð ì û ÿDæ êèAé æ=Þ4ñ$Ü%ß � äkù�ä � ê Ü � � �Aé Ý�4Þ�ö8ñDÞÞ ïFæ �3í% %î ò2� ï� æsú ê æ@Þ8ñ$Ü �íGë ñ�æ0Þ ïFðGäkù�ä � ê Ü �)Ý��8Þ8ö�ñDÞ4Þ ïFæ�ý ò�ÿ���äkù�ä � ê Ü � ì ñDß�ñ$Ü%ü4ü ó%Þ8ö ïAý�ÿ$ñ ë+3 ö ïAý'ÿ�ñ ë4 %î ß<û 3 Û�Ü ïFð ì� Ý$ù � ä7ú÷�ß657 ù0ä7ú ê Ü � ê ��û ñ ë�ê÷ ì Ü �ö8ñDÞ8Þ ïFæ¯ç�ÿ$ñDß ì]í ç ï�8� ê�ë äkù�ä � ê Ü �,æ7ï� æ�ç ë þZß<û ì ñDß�ñ�Ü%ü ê �÷8ðsñ��4Þ ïFæ�þ<ý ò î ßsýHä õ�Ü%ñ � Þ4ñ$ÜAÛ�Ü � Þ ê ð ì û ÿDæsúû ñ ë ! 3 Þ8ñ$Ü ì Ü òAñ ë ôsñ�õ�ä7ç8ùèAé ê æ�þ î ÿ 3 Þ8ñ�Üäkùè4ê Þ 3 Þ8ñ�Ü ì û ä ê 5�ä 5 å8Þ�ÝDù � Þ4ñ$Ü�ä õ ÷ é ß�ä7ú÷�ß�ü ó%Þ �í% %î ò ë û ñ����9 � æsý ò�ÿ��0äkù�ä � ê Ü �

ÿ ïAú8ü � Û�Ü ��ì�ë ç:�;� ê�ë ð � æ � � çè4ê Þ4ñ$ÜAõ�ï=<Uæ0ñ�ç�ÿ$ñ$ß�ä � òAñ ö�õ è � æ���ñ�æ�ä Þ�Aé ��ÿ$Þ ïFðsÞ4ù�þZÞ�� ê�ë äkù�ä � ê Ü ��ç �'& ö � þý ò>.9 Þ"?�ñDÞ4ñ$Ü * òäkù�ä � ê Ü � %î ò ê ��û ñ ëÛ�Ü ��ì÷ � �÷�ôsñ�õ¶Ú%ý�� î ù� Þ0äkù�Aé � ë ç�ÿ$ñDß@0÷�ý'õ�ù8ñ�ý � �Aé ê ñ�ö'ö � ä Þ÷�ýHä æ è �3ê'î ñ æ�ð � æ � � ö � ü ó%Þ4Þ4ù�û ñ�ÿ$ü9'ë�ê� Þ î ù8ñ���ç4Ü ï�Yë4 æ�ð � úû ê !$þ�Û

A@B-C"DFEGD2H@IKJ L8MNEPO�QSRGQKT$RGR UV;WUGXZY I\[PT1]

A@B A

Page 32: Grokking thegimp

^+_ `badc�egf�h�i

jlknmlo prq f�h�i#s,t u�v$uw q vlx/y/z {,u/y�s�|,t k}�~� y�x��'���p�~ � s�� �r� }�k y+�(� �r� }�k y4�)�$�4t �Z�@� �F�@�p�� |��"��z� ���� |$��z�u�� �

2.1 Layers and the Role They Play in Images

Figure 2.1 will be used to describe some of

Figure 2.1

the fundamental features of layers. Although this image is constructed of three layers, this is not evidentfrom looking at it in the image window. To understand and work with the layer structure of an image youmust use the Layers dialog. However, before describing this important tool, let's look at Figure 2.2, which isa

Figure 2.2

useful illustration of how layers are used to make up images. Figure 2.2 shows a 3D break-out of how the three-layer stack relates to the 2D image shown in Figure 2.1.The bottom layer is a picture of a gopher couple; this layer is fully opaque. The middle layer has the samedimensions as the bottom layer and is completely transparent except for a small white rectangular region.The white rectangle itself is partially transparent (thus, the bottom layer can be perceived through it). Finally,the top layer's dimensions are smaller than either the bottom or middle layers. The top layer is alsotransparent except for the text Prairie Pranks. The vertical red dashed lines in Figure 2.2 show that the textin the top layer is positioned directly over the white rectangle in the middle layer. The black frames shown inthe figure have been drawn in to show the positions of the text and the white rectangle but are not actuallypart of the image (refer to Figure 2.1).

The 3D layer stack shown in Figure 2.2 is a useful mental model for understanding how layers work in animage. It also underscores the utility of having image components on layers. Because the text is on a layer,it can be positioned independently of the lowest layer. Because the white rectangle is on a layer, its partialtransparency can be adjusted without affecting the text.

2.1.1 The Layers Dialog

It is impossible to work with images without knowing their layer structure. This information is provided by theLayers dialog, which is part of the Layers & Channels window. The Layers & Channels window can befound in the Image:Layers menu, the Image:Dialogs menu, or can be invoked by simply typing C-l in theimage window. Figure 2.3(a)

Figure 2.3

shows the multilayer image from Figure 2.1, and Figure 2.3(b) shows the associated Layers dialog. The Layers dialog has many components. Let's take a moment to briefly describe each one. Figure 2.4illustrates the dialog's

Figure 2.4

various components. The most important feature of the Layers dialog is the Layers Palette . This region of the dialog consists of horizontal strips, each representing a single layer in the image. Itcan be seen from Figure 2.4 that this is the Layers dialog for an image with three layers. Note that

Page 33: Grokking thegimp

each strip displays a thumbnail image of its layer's contents. The strips are organized vertically in astack, and this stack shows the 3D relationship of the layers in a 2D manner. The top, middle, andbottom layers of the stack represent the layers analogously to the conceptual 3D view shown inFigure 2.2 . In addition to showing the layer ordering structure of an image, the Layers Palette provides usefulinformation and tools for working with the image. As shown in Figure 2.4, the area to the far left of the LayerThumbnail contains the Eye icon. If this icon is visible, the corresponding layer is visible in the imagewindow. The Eye icon can be toggled off by clicking on it. This makes the corresponding layer invisible inthe image window. Toggling it again brings the layer back.

The region of the strip just to the left of the thumbnail and to the right of the Eye icon is the position of theLayer Link icon. Clicking in this area makes a four-way arrow appear, as shown in two of Figure 2.4's layerstrips. When this icon is activated for several layers at once, they are linked together with respect to theMove tool. These layers will now move together as a single unit (the Move tool is covered in Section 2.6.1).

To the right of the thumbnail is the Layer Title Area, which, for a new image, is named Background bydefault. The title can be changed by double-clicking in the Layer Title Area. This brings up a dialog boxwhere the new title can be entered.

The middle layer strip in Figure 2.4 is highlighted in blue, indicating that it is the active. layer GIMP toolsapplied to the image window are applied to this layer. This is very important, so read these last twosentences again! The GIMP tools and filters are applied to the active layer. Not knowing which layer isactive is a formula for confusion and frustration. The identity of the active layer can only be reliablydetermined by having the Layers dialog open. Any layer can be made active by clicking on its thumbnail orTitle Area. Only one layer can be active at a time.

Outside of the Layers Palette area are several other important features of the Layers dialog. First, there aretwo pull-down menus labeled Image and Mode. The Image menu is used to specify the context of theLayers dialog. The GIMP can have many image windows open simultaneously. When there is more thanone image window open, this menu is used to select the one whose layers are displayed in the LayersPalette area. If the Auto Context button is toggled on (which it is by default), any keystroke in an imagewindow will change the Layers Palette context auto-magically to that window. I like to use the space bar forthis.

The Mode menu selects how the pixels of the active layer are visually blended with those beneath it. Eachlayer has a blending mode context that is specified using this menu. Blending modes are described in moredetail in Chapter 5.

The remaining features of the Layers dialog consist of the Opacity slider, the Keep Trans. toggle button,and, at the bottom of the dialog, a row of function buttons that I call the button bar. These are all discussedin more detail later. However, of these features, the Opacity slider is of immediate interest because it isused in the example shown in Figure 2.3. Figure 2.3(b) shows that the the middle layer strip is highlighted,indicating that this layer, containing the small white rectangle, is active. Careful examination of the Layersdialog shows that the Opacity slider is set to 60.0% for this layer. This means that the layer below can beseen through the white rectangle because the rectangle's layer is only partially opaque. Like for the blendingmodes, opacity can be independently set for each layer.

2.1.2 The Layers Menu

In addition to the features described in the previous section, the Layers dialog has a hidden menu. Thismenu is displayed by right-clicking on the highlighted active layer in the Layers Palette. This is called theLayers menu. Figure 2.5(a)

Figure 2.5

illustrates the Layers dialog, and the Layers menu is shown in Figure 2.5(b) and (c). The functions providedby the Layers menu are described shortly, but before covering them we need to take a slight detour todiscuss another element of images: channels.

Page 34: Grokking thegimp

2.2 Channels and Their Relationship to Layers

Recall that images are constructed from layers and layers from pixels. However, there is another importantcomponent in the image structure hierarchy. Layers can be decomposed into sublayers called channels.Layers are constructed of one to four channels. In this book almost all our work is performed on RGBimages. For these types of images each layer consists of four channels known as R, G, B, and A. These arethe red, green, blue, and alpha components of a layer, respectively. The R, G, and B channels contain thecolor information about the layer, and the A channel describes how opaque the layer is to what is behind it.An exception to this rule is that the default, background layer of a newly created or freshly opened RGBimage contains no alpha channel.

A complete diagram of the image component hierarchy is illustrated in Figure 2.6.

Figure 2.6

In the standard distribution of the GIMP, channels are eight bits deep, meaning that each pixel in a layer isrepresented by up to 32 bits. However, there is a special development version of the GIMP that useschannels that are 16 bits deep, making for layers with pixels represented by up to 64 bits. This is known asthe Hollywood branch of the GIMP because it is useful for film and high-quality studio production imagery.More on Hollywood can be found at http://film.gimp.org .

2.2.1 The Channels Dialog

Like for layers, there is a dialog for viewing channels called the Channels dialog . This is accessed byclicking on the Channels tab in the Layers & Channels window (see Figure 2.4). The Channels dialog isshown in Figure 2.7.

Figure 2.7

Here the Red, Green, and Blue channels are labeled. They can be seen in the Channels Palette area, whichis analogous to the Layers Palette discussed in the previous section. Note that unlike the Layers palette,more than one channel can be active at a time. In fact, all three channels are active at once, meaning thatall operations performed in the image window are applied to all three channels. Also note that there are just three channels in this dialog, not three channels for each layer. These channelsrepresent the global red, green, and blue of the image. For multilayer images, the R, G, and B channels ofeach individual layer are not accessible in the Channels dialog. They can be extracted for an individual layerby deleting the other layers or by copying and pasting the layer to a separate image window. Anotherpossibility for accessing the individual color channels of a layer is to use the Decompose function, which isdiscussed in Section 4.5.3.

Any of the R, G, and B channels can be made inactive by clicking on the channel title. Doing so means thatsubsequent operations in the image window affect only the remaining active channels . The visibility of thechannels, like for layers, can be toggled using the Eye icons.

The Channels dialog can be used to create additional channels for an image. These are called ChannelMasks, and a discussion of these is deferred to Section 4.1. As a final note, Figure 2.6 suggests that thealpha component of a layer should be found somewhere in the Layers or Channels dialogs. This is indeedcorrect, but this topic is deferred to Section 4.2.

2.3 Layer Creation, Deletion, Duplication, and Organization

We now return to the functions contained in the Layers menu shown in Figure 2.5. The most basic layeroperations are those of creation, deletion, duplication, and organization. These functions are controlled withthe menu entries shown in Figures 2.5(b) and (c) but are more easily accessed using the button bar locatedat the bottom of the Layers dialog.

Page 35: Grokking thegimp

2.3.1 Creating New Layers

The first entry in the Layers menu is New Layer . Clicking on this function brings up a dialog that allows theuser to name the new layer and choose its dimensions. The default dimensions are those of the existingimage. Also, the user can choose whether the created layer is white, the foreground or background colors,or transparent. The foreground and background colors are those displayed in the Active Foreground Colorand Active Background Color patches in the Toolbox window. The new layer is inserted just above theactive layer, becoming immediately apparent in the Layers Palette. The New Layer function is also providedby the button in the button bar depicting the single sheet of paper.

2.3.2 Raising Layers

The order of layers in the Layers Palette controls how the layers are perceived in the image. The RaiseLayer entry, shown in Figure 2.5(c), shifts the active layer up by one, if possible, in the layer stack. Thefunction Layer to Top puts the active layer at the top of the stack.

Raise Layer and Layer to Top are also available from the button bar. The upward-pointing arrow iconprovides these functions. Clicking on this button raises the active layer, and Shift-clicking raises the layer tothe top of the stack. Note that if the lowest layer of the stack does not have an alpha channel, it cannot beraised.

2.3.3 Lowering Layers

The Lower Layer entry in the Layers menu shifts the active layer down by one in the layer stack, and Layerto Bottom moves it to the bottom of the stack. The same functions are provided by the downward-pointingarrow icon in the button bar. Clicking on the icon lowers the active layer once, and Shift-clicking puts it to thebottom of the stack. Note that if the lowest layer of the stack does not have an alpha channel, another layercannot be made lower than it.

2.3.4 Duplicating Layers

The active layer can be duplicated by clicking on the Duplicate Layer entry in the Layers menu. Theduplicated layer is positioned just above the active layer. This function is also provided by the buttondepicting the two sheets of paper in the button bar.

2.3.5 Deleting Layers

The active layer can be deleted by selecting the Delete Layer entry from the Layers menu. This function isalso provided by the button in the button bar depicting a Trash Can.

2.4 Layer Export and Import

Collecting separate, raw image elements into a single image window is one of the most-used layeroperations in this book. This is a fundamental component of compositing, a subject discussed in great depthin Chapter 7. However, it is also useful for a wide range of core and advanced techniques in the GIMP.

The importation of layers into an image is accomplished using the Copy , Cut, and Paste editing functions(see Section 1.7). The technique for importing a layer is so important that this section develops an examplein detail to illustrate the methodology. Study it well, because this technique is used often in this book.

To illustrate the process, we begin with the two images shown in Figure 2.8. Each image consists of a

Page 36: Grokking thegimp

Figure 2.8

single layer, and each will be imported into a third image that, on completion of the procedure, will containthree layers. To begin, a new image is created that has width and height sufficient to accommodate the two single-layerimages. Once open, the eagle image in Figure 2.8(a) is copied and pasted into it. This is accomplished bymoving the mouse cursor into the eagle image window and selecting the Copy function from the Image:Editmenu. This can also be accomplished by simply typing C-c in the image window. This copies the activelayer of the eagle image into the default buffer. Note that for multiple-layer images, it is the active layer thatis copied into the buffer. Thus, it would be prudent to verify which layer is active by inspecting the Layersdialog before copying. The whole procedure could also be performed by cutting the image instead ofcopying. Cutting puts a copy of the layer in the buffer and then deletes it from the image window. To cut theimage, use the Cut function from the Image:Edit menu. This function can be more easily employed bytyping C-x in the image window.

Now that the eagle image is in the buffer, it can be pasted into the new image. This is done by moving themouse cursor into the new image window and using the Paste function found in the Image:Edit menu, whichcan be more expeditiously accomplished by typing C-v in the image window. The result of the paste isshown in Figure 2.9(a).

Figure 2.9

The Layers dialog for this image is shown in Figure 2.9(b), and it shows that the pasted layer appears as afloating selection. The Background layer, the only other layer in the dialog, is grayed out, meaning that itcannot be selected as the active layer. The pasted layer appears in Figure 2.9(a) as a selection with a moving dashed line around it. These movingdashes are referred to as the Marching Ants. This floating selection can be positioned in the new imagewith the Move tool from the Toolbox.

Once the layer is positioned, it can be anchored to the underlying layer by bringing up the Layers menu andselecting the Anchor Layer function from the Layers menu or by typing C-h in either the Layers & Channelsor image windows. It is also possible to simply click on the Anchor button in the Layers dialog. For thisexample, however, the layer is not anchored to the layer below it. Rather, it is converted into a new layer.This is done by using the New Layer function found in the Layers menu. Figure 2.10

Figure 2.10

illustrates the result of the conversion. Figure 2.10(a) shows how the converted layer is smaller than theimage window. Figure 2.10(b) illustrates the corresponding Layers dialog showing that the float wasconverted to a layer. A floating selection can also be converted to a new layer by typing C-n in the Layers &Channels window or by clicking on the New Layer icon in the button bar. The sequence just described for importing the eagle image is used so often that it deserves to bememorized. Let's concisely recap the steps required...then bookmark this page! The following list of stepsslightly generalizes the procedure by assuming that there is a multilayer source image window containing alayer to be exported and another multilayered destination image that will import it:

1. In the source image window, type C-l to bring up the Layers dialog.

2. In the Layers dialog, make the source layer active by clicking on its thumbnail in the Layers Palette.

3. Back in the source image window, type C-c to copy the active layer to the default buffer.

4. In the destination image window, type C-v to paste the buffer contents into a floating selection. (Notethat the context of the Layers dialog automatically changes to the destination image window when C-v is typed there.)

5. Position the floating selection as desired with the Move tool.

6. Type C-n in the Layers dialog (or click on the New Layer button) to anchor the float to a new layer.Otherwise, type C-h or click the Anchor button to anchor it to the last active layer of the destinationimage.

Page 37: Grokking thegimp

By the way, when the floating selection is converted to a new layer, the resulting dimensions of the layer arejust large enough to contain the contents of the pasted layer. As shown in Figure 2.10(a) the resultingpasted eagle image layer is smaller than the image window. It is easy to put the pasted image into aseparate layer having the same dimensions as the destination image window. Just create a new layer in thedestination image before pasting from the buffer. After pasting, anchor the floating selection to this newlayer by clicking the anchor icon in the button bar.

Repeating the import procedure for the airplane in Figure 2.8(b) produces the result shown in Figure 2.11.

Figure 2.11

Note that the boundary of the active layer in Figure 2.11(a) is visible as a black-and-yellow dashed line.Typically we are not aware of layer boundaries because often all the layers have the same dimensions.When this is the case, the layer boundary is coincident with the window edge. However, for the caseillustrated in Figure 2.11(a), the layer boundary is apparent because the pasted layer is smaller than theimage window.

The visible boundary of a layer can be a problem, especially when you're trying to adjust the relativeposition of two layers or when you're trying to carefully match colors at layer edges (for a particularly goodexample of this problem, see Section 7.5). When it is desirable to suppress the layer boundary, its visibilitycan be turned off with the function Toggle Selection, found in the Image:View menu or by typing C-t in theimage window.

2.5 Floats

In the previous section we came across a special layer called a floating selection, often simply referred to asa float. A float is a temporary layer that gets created automatically under certain circumstances and that canbe explicitly created if needed. A float is a special type of layer. All other layers are disabled when a float iscreated, and nothing can be done with the other layers until the float is anchored. Although the other layersare disabled, almost all GIMP operations can still be performed on the floating layer.

Floats are sort of a throwback, a vestige of prehistoric times when the GIMP had not yet evolved into alayer-based tool. Back then, it was necessary to have floats because that was the only way to selectivelyprocess parts of an image. Now it is more effective to separate various image components into differentlayers, allowing you to more conveniently and effectively process and combine them. Nevertheless, asalready noted, they are created automatically, so it is important to know how they work and what to do withthem. There are basically three things about floats that you need to know: when they are automaticallycreated, how they can be explicitly created, and how they are anchored.

2.5.1 Automatic Creation of Floats

There are two circumstances under which floats are created. The first occurs after you make a selection.After the selection is made, it becomes immediately possible to move it (even without selecting the Move tool). This is done by placing the mouse cursor inside the selection (the cursor becomes a four-way arrow)and by clicking and dragging. After you release the selection, it automatically becomes a floating selection.Figure 2.12(a)

Figure 2.12

illustrates a selection that has been moved. The corresponding Layers dialog, shown in Figure 2.12(b),shows the new layer, entitled Floating Selection. Also note that the original layer is grayed out, indicatingthat it has been disabled from other GIMP operations. The second way that a floating layer is automatically created is after a copy and paste or a cut and pasteoperation. Whether the default buffer contains a selection or an entire layer, pasting from the bufferproduces a float.

Page 38: Grokking thegimp

2.5.2 Explicit Creation of Floats

A selection can be explicitly made into a float without moving it. This is done by using the Float functionfound in the Image:Select menu or by simply typing C-S-l in the image window. A good use for the explicitcreation of a float is described in Section 2.6.2.

2.5.3 Anchoring Floats

After a float has been created, normal operations cannot continue in the GIMP until the float is anchored.Anchoring is just the operation of depositing the float into a normal layer. Once this is done, the other layersbecome available for GIMP operations again. A layer can be anchored either to a new layer or to the lastactive layer before the float was created. A float is anchored to a new layer by selecting New Layer from theLayers menu or by clicking on the New Layer button in the Layers dialog. A float is anchored to thepreviously active layer by using the Anchor Layer function from the Layers menu, by typing C-h in theimage window, or by clicking on the Anchor button in the Layers dialog.

2.6 Manipulating Layers

As already discussed, layers are the most important image components for image manipulation. They arethe basic raw materials you want to work with and combine. In most every GIMP project, layers need to bemoved, resized, positioned, transformed, cut, pasted, and so on. These types of layer operations arediscussed in this section.

2.6.1 Positioning Layers

One of the most basic layer operations is positioning. Compositing from a set of raw image materialsrequires that the various components, each on a separate layer, be appropriately positioned. This sectiondescribes several techniques for layer positioning.

2.6.1.1 Moving Layers

Moving a layer is accomplished using the Move tool. This tool is invoked by clicking on the Toolbox buttondisplaying the four-way arrow icon. Clicking on this tool changes the mouse cursor to a four-way arrowwhen it is in the image window. Clicking and dragging while the cursor is in the image window causes thelayer underneath the mouse cursor to move. The layer affected is the one that is highest in the layer stackand has pixels more than 50% opaque under the mouse cursor (see Section 5.7 for more on opacity andtransparency). This means that if the top layer is transparent at the mouse cursor position, it is not moved.This also means that if the active layer is transparent at the mouse cursor position it is not moved. Rather, itis the first layer from the top that has more than 50% opaque pixels under the mouse cursor that is moved.Alternatively, the active layer can be forced to move by Shift-clicking and dragging. This moves the activelayer regardless of its visibility, degree of transparency, or position with respect to the cursor.

2.6.1.2 Aligning Layers with Guides

Sometimes a layer needs to be positioned more carefully than can be easily judged by eye. Under thesecircumstances, it is often convenient to use guides to facilitate their placement. Guides are useful becausethey have a snapping property . A layer released sufficiently near a guide will jump to the guide position.The snapping property of guides is controlled by the Snap to Guides checkbox in the Image:View menu.The checkbox must be toggled on for the snapping property to work.

To illustrate how guides are useful for layer positioning, the three planet images shown in Figures 2.13(a),(b), and (c)

Page 39: Grokking thegimp

Figure 2.13

were each copied and pasted to new layers in a larger image window with a black background. This isshown in Figure 2.14.

Figure 2.14

The objective is to organize the planets on a diagonal, but with a uniform black border between them andthe window edge. This was done by placing two horizontal and two vertical guides in the image window,each positioned exactly three ruler tick marks from the edge. Where do the guides come from? Well, theyare hidden inside the rulers at the left and top edges of the image window. Clicking on a ruler and thendragging the mouse into the image window drags a guide along with it. Releasing the mouse buttonpositions the guide. Any number of guides can be created in this way. Once the guides are positioned, theirvisibility can be toggled on or off with the Toggle Guides function, found in the Image:View menu, or bytyping C-S-t in the image window.

The guides can be seen in Figure 2.14 as blue dashed lines. The Jupiter and Earth layers were positionedwith the Move tool so that their corners were aligned at the cross-hairs of the guides. It can be seen that theactive layer, designated by the yellow dashed boundaries shown in Figure 2.14, are perfectly aligned withthe guides. That the layers snapped to the guides simplified the positioning operation. When no longerneeded, the guides can be moved off the image by first activating the Move tool from the Toolbox and thenusing the mouse to drag the guides back into the rulers.

2.6.1.3 Toggling the Layer Boundary

Careful alignment or color matching between layers is often required for layer edges that are overlapping orabutting. The layer boundaries of the active layer can be seen in the image window, even when the layercontents cannot be seen. This boundary, consisting of a black-and-yellow dashed line, can impede theprecision with which alignment and color matching work is performed. Under these circumstances it isuseful to visually toggle off the layer boundaries, which is easily done with the Toggle Selection function,found in the Image:View menu. Alternatively, C-t can be typed in the image window. The visibility of thelayer boundaries is restored by toggling a second time.

2.6.2 Resizing and Scaling

As was seen in Figures 2.2 and 2.10(a), the layers in an image need not all be the same size. Furthermore,changing a layer's dimensions can be quite useful. In the parlance of the GIMP, a layer can be resized,which means that its boundaries are shrunk or enlarged without changing the dimensions of the image'scontents. Alternatively, a layer can be scaled, which means that the dimensions of the layer are changedand the image contents are stretched or squeezed to exactly fit within the new layer boundaries. Sixfunctions in the GIMP resize or scale layers and images:

� Layer Boundary Size, found in the Layers menu � Scale Layer, found in the Layers menu � Canvas Size, found in the Image:Image menu � Scale Image, found in the Image:Image menu � The Crop tool from the Toolbox � The Transform tool from the Toolbox

Each of these are discussed and compared in the following sections.

2.6.2.1 Image Scaling

Scaling an image results in changing the dimensions of all the layers at once, while simultaneouslystretching or squeezing the image contents to fit. The function Scale Image , found in the Image:Imagemenu, is the tool that accomplishes this. Figure 2.15(a)

Figure 2.15

Page 40: Grokking thegimp

shows an example image, and Figure 2.15(b) shows the Scale Image dialog. The new width and height ofthe image can be specified in pixels or as a percentage of the current dimensions. The default is to scalethe two dimensions proportionally, but this can be changed by toggling the chain icon next to the Ratio Xand Y entry boxes. The result of scaling down the image shown in Figure 2.15(a) by 75% is shown inFigure 2.15(c). The result of scaling it up by 125% is shown in Figure 2.15(d).

2.6.2.2 Image Resizing

At first blush it would seem that the Canvas Size function found in the Image:Image menu should work in asimilar fashion to Scale Image. However, there is an important difference between resizing an image andscaling it. Because the image contents do not change with the image boundaries, there is a non-uniquechoice in how they are positioned within the resized image window. Thus, when resizing to a smaller imagewindow, the position of the image within the new window depends on the values for the new width, height,and X and Y offsets

Figure 2.16

illustrates how using Canvas Size can give rise to an inconvenient problem. Figure 2.16(a) shows theoriginal image, and Figure 2.16(b) shows the Set Canvas Size dialog. In the dialog the X and Y ratios havebeen set to 50% of the original image size. The result is shown in Figure 2.16(c). As can be seen, the imageis poorly positioned within the new window. This can be compensated for by using the Move tool toreposition the image inside the window. The result of doing this is shown in Figure 2.16(d). However, theresult still leaves the image subject, the wolf's head, poorly framed. The problem is that there is no easyway to enter numbers into the Set Canvas Size dialog to obtain an aesthetically pleasing result. A better solution is to resize the image interactively using the Crop tool. Figure 2.17

Figure 2.17

illustrates how the original image can be resized smaller this way. The tool is applied by clicking on the Croptool icon in the Toolbox and then clicking and dragging in the image window to create the crop rectangle.Once drawn, the dimensions of the crop rectangle can be adjusted by clicking and dragging either theupper-left or lower-right corners of the rectangle. The rectangle can also be repositioned by clicking anddragging the upper-right or lower-left corners. The result of using the Crop tool to nicely frame the wolf's head is shown in Figure 2.17(a). When using thistool, the Crop dialog appears, as shown in Figure 2.17(b). It is possible to crop the image by clicking on theCrop button in the dialog or by simply clicking inside the crop rectangle in the image window. This makesthe image smaller and simultaneously discards the image parts outside of the window. Alternatively, theimage can be resized by clicking on the Resize button in the Crop dialog. This makes the image windowsmaller without discarding the image parts outside the resulting window.

Figure 2.17(c) shows the result of cropping the image to the crop rectangle seen in Figure 2.17(a). From theabove discussion, it should be clear that there is really no reason to use Canvas Size to make an imagewindow smaller. It is simply more convenient to do it with the Crop tool.

Although Canvas Size is not optimum for making an image smaller, it is quite useful for making it larger.This is especially valuable when compositing several raw images. Typically you discover, after positioningvarious imported layers, that the resulting image window is not large enough to adequately frame thecomposition. When this happens, Canvas Size is the tool that fixes the problem. Figure 2.18

Figure 2.18

illustrates the result of resizing an image. Figure 2.18(a) shows the original image, and Figure 2.18(b) shows the Set Canvas Size dialog box. Thistime the X and Y ratios are scaled to 125% of the original. The result is shown in Figure 2.18(c). Once theimage window has been resized it is possible to reposition the image layer or layers using the Move tool.

2.6.2.3 Layer Scaling

As has already been discussed in this section, it is possible to scale an entire image. However, it is also

Page 41: Grokking thegimp

possible to scale a single layer within an image. There are two tools for doing this in the GIMP: the ScaleLayer function, found in the Layers menu, and the Transform tool in the Toolbox.

As for entire images, a layer can be scaled either smaller or larger. The most typical use of layer scaling isto adjust the relative size of an image on one layer with respect to an image in another. This is needed foralmost every compositing project (for examples, see Chapter 7). When it is necessary to scale a layersmaller, either the Scale Layer function or the scaling option of the Transform tool will do the trick. However,the Transform tool might be preferable because it provides interactive control of the scaling process. ScaleLayer relies on entering numbers into entry boxes in a dialog. It is difficult to choose the correct dimensions,which leads to repeatedly applying Scale Layer and Undo until the desired effect is achieved.

The problem of finding the right dimensions to scale a layer can sometimes be solved using the Measure tool, which is discussed in more detail in Section 2.6.5. A good example of using the Measure tool todetermine the appropriate amount to rescale a layer is given in Section 7.5. Alternatively, the Transform toolprovides interactive visual feedback of the scaling process. In addition, it can be used in conjunction with theBezier Path tool and the Transform Lock icon in the Paths dialog to get very fine, interactive scalingcontrol. The technique for this is discussed in Section 3.4.1, and a relevant example is shown in Section 7.2.

Scaling a layer larger should be avoided if possible, because this operation requires the interpolation ofpixel values. Interpolation is an approximation process that creates pixels where there were none beforeand that, consequently, partially degrades the layer's image quality. Thus, when adjusting the relative sizesof several image components on different layers, it is preferable to scale down the larger components tomatch the size of the smaller ones rather than vice versa.

In the event that it is necessary to scale a layer larger, it is important to know that a layer cannot be scaledto dimensions larger than those of the existing image boundaries. To scale a layer to dimensions greaterthan these limits, the image window must first be resized larger using the function Canvas Size, previouslydiscussed.

2.6.2.4 Layer Resizing

As with scaling, a layer can be resized smaller or larger. This is done with Layer Boundary Size, found inthe Layers menu. Typically you resize a layer to a smaller dimension to eliminate undesirable parts.However, resizing a layer smaller has the same problem as resizing an image. That is, the subject matter ofthe layer must be properly positioned within the resulting layer boundaries. For images, the positioningproblem was solved using the Crop tool, but this will not work for resizing layers. Fortunately there is asimple procedure that produces the same effect and allows for the interactive positioning of the layercontents within the smaller layer boundaries.

Figures 2.19 and 2.20 illustrate

Figure 2.19

Figure 2.20

how this is done. The method consists of a four-step procedure:

1. The region to be framed in the layer is selected with the Rectangle Select tool (see Chapter 3 formore on selections). Figure 2.19(a) shows how a rectangular selection has been made in an imagewindow.

2. The selection is then converted to a floating selection using the function Float from the Image:Selectmenu or by typing C-S-l in the image window. Figure 2.19(b) shows the Layers dialog after theselection has been converted to a float.

3. The floating selection is then made into a new layer by choosing the New Layer function in the Layersmenu or by clicking the New Layer button in the Layers dialog. Figure 2.20(a) shows the Layersdialog corresponding to this step.

4.

Page 42: Grokking thegimp

The old layer is made active, as shown by the Layers dialog in Figure 2.20(b), and is deleted byclicking on the trash can icon in the button bar.

The result of resizing the layer smaller is shown in Figure 2.21.

Figure 2.21

In Figure 2.21(a) the layer has been resized smaller, which can be seen by the black-and-yellow dashedlayer boundary. Figure 2.21(b) shows the resulting Layers dialog. The procedure, as described, allows thelayer contents to be carefully positioned within the resized layer. Although there are good reasons to resize an image larger, it is difficult to imagine a good reason forresizing a layer larger. However, due probably to a rationale of symmetry, a layer can be resized larger. Itshould be noted that, as for layer scaling, the GIMP does not allow a layer to be resized to dimensionslarger than the window boundaries of an image. To resize a layer larger than the current image boundaries,the image must first be resized to accommodate it.

2.6.3 Flipping

The active layer can be flipped around its vertical or horizontal axes with the Flip tool from the Toolbox. Aflip is performed by clicking on the Flip tool icon, represented by a two-way arrow in the Toolbox, and thenby clicking in the image window. When in the image window, the mouse cursor appears as a two-way arrowthat is oriented horizontally for horizontal flips and vertically for vertical flips.

As an example of using the Flip tool, Figure 2.22(a)

Figure 2.22

shows an image of a pelican and Figure 2.22(b) shows the result after flipping the image horizontally. Notethat the Horizontal radio button is selected in the Tool Options dialog, as shown in Figure 2.22(c). Selectingthe Vertical radio button, as shown in Figure 2.22(e), produces the result in Figure 2.22(d). Note that if the Horizontal radio button is selected in the Tool Options dialog the flip option can bemomentarily toggled to Vertical by Control-clicking in the image window. Similarly, if the Vertical radio buttonis selected in the dialog, the option can be toggled to Horizontal option by Control-clicking in the imagewindow.

2.6.4 Rotating in 90o Increments

An image or layer can be rotated in 90o increments using the Rotate menus. For an image, use theImage:Image/Transforms/Rotate menu shown in Figure 2.23(a).

Figure 2.23

For a layer, use the Image:Layers/Rotate menu shown in Figure 2.23(b). As you can see, these menus canbe used to rotate either the entire image or the active layer by by 90, 180, or 270o.

2.6.5 The Transform Tool

General transformations of a layer can be done using the Transform tool from the Toolbox. This tool canperform rotation, scaling, shearing, and perspective transformations of the active layer. As usual, care mustbe taken to specify the active layer before applying this tool.

Figure 2.24

illustrates an image layer contained in a somewhat larger window. Shown in Figure 2.24(b) is the ToolOptions dialog, which is obtained by double-clicking the Transform tool icon in the Toolbox window. The fourradio buttons in the Transform area of the dialog are used to select the desired transformation type, which

Page 43: Grokking thegimp

can be Rotation, Scaling, Shearing, or Perspective. Transforming a layer requires interpolation of pixel values, and this can introduce some jagged-edgeartifacts into the result. The toggle button labeled Smoothing diminishes this effect, which is why it is on bydefault. It does tend to make the image a little less sharp, though (see Section 6.4.1 for a discussion of howto recover some of the lost sharpness).

The Tool paradigm area of the dialog has two options. The default is Traditional, which maps the image to atransformed grid (see Figure 2.26). For those who like to go against the grain, the Corrective option mapsthe transformed grid to the image, thus producing an inverse transformation. For example, rotating thetransform grid in one direction with the Corrective option maps the grid back to the image, making the imageitself rotate in the opposite direction. Sound complicated? It isn't. Just try it yourself and you'll see.

2.6.5.0.1 Rotation

Figure 2.25

Figure 2.26

illustrate the use of the Rotation option of the Transform tool. Figure 2.25(a) shows the image layer, andFigure 2.25(b) the Rotation Information dialog that appears when the left mouse button is clicked in theimage window. The Rotation Information dialog has entry boxes that can be used to give a specific angle ofrotation as well as the position of the point that will be the center of rotation. By default, the center ofrotation is the geometric center of the active layer. For each of the Transform options, Rotation, Scaling, Shearing, or Perspective, the first mouse click on theimage brings up a dialog specific to the chosen option. This mouse click also displays a grid superimposedon the active layer in the image window. The number of grid lines can be controlled from the Tool Optionsdialog (see Figure 2.24(b)). The grid lines can be seen in Figure 2.25(c). Placing the mouse cursor withinthe active layer in the image window changes the cursor in accordance with the type of transformation to beperformed. The image outline and grid can then be transformed by clicking and dragging. Thetransformation of the grid can be adjusted as many times as desired because the transformation of theimage is not initiated until the option transform button is clicked. For example, the Rotate button inFigure 2.26(b) must be clicked to cause the actual rotation of the image.

As the grid is rotated for the Rotate option of the Transform tool, the angle is interactively reported in theRotation Information dialog. The rotated outline for an angle of 25o is shown in Figure 2.26(a). As alreadystated, once the desired angle of rotation is found, the image itself is rotated by clicking on the Rotatebutton, seen in the dialog shown in Figure 2.26(b). The resulting rotated layer is shown in Figure 2.26(c).

As an alternative to interactively rotating the grid with the mouse, the rotation can also be performed byentering a value into the Angle entry box or by using the slider in the Rotation dialog. Useful values ofrotation can be determined with the Measure tool. An example of this is illustrated in Section 7.2.

2.6.5.0.2 Scaling

Figure 2.27

illustrates the Scaling option of the Transform tool. Like for rotation, scaling can be performed interactivelywith the mouse or by entering values into the Width and Height entry boxes in the Scaling dialog. Values can be entered into the Scaling dialog in a number of units, the default being pixels. It is oftenconvenient to perform scaling as a percentage of the original dimensions (which are shown at the top of theScaling dialog as the Original Width and Height). This can be done by choosing the % option from the pull-down menu in the dialog. Figure 2.27(b) shows that this choice was used to scale the grid in Figure 2.27(a)by 50% in both dimensions. When the Scale button in the dialog is clicked, this produces the result shown inFigure 2.27(c).

It is useful to be able to constrain the X and Y scale ratio so as to maintain their aspect ratio when scaling alayer with the Transform tool. This is done by pressing both the Control and Alt keys while using the mouseto scale the transform grid. Useful values for scaling can be determined using the Measure tool. Section 7.5illustrates an example of this.

Page 44: Grokking thegimp

2.6.5.0.3 Shearing

Figure 2.28

shows the application of the Shearing option of the Transform tool. As with the other options, shearing canbe applied interactively with the mouse or by entering values into the Shear Information dialog. Shearingcan be applied either horizontally or vertically, but not in both directions simultaneously. If applied using themouse, the direction of shear is determined by the mouse's initial direction of movement. Otherwise, itdepends on the first entry box used in the dialog.

2.6.5.0.4 Perspective

Perspective is perhaps the most intriguing option of the Transform tool. This option is illustrated inFigure 2.29.

Figure 2.29

This is the only transform option where values cannot be directly entered into a dialog. As shown inFigure 2.29(b), there is numerical feedback about how the Perspective transform option is applied to theimage, but this is not particularly valuable because it is unclear how to reuse the information. Theconsequence is that the Perspective option may only be applied interactively with the mouse. Figure 2.29(a) shows that the grid line feature provides very useful feedback for this particular tool. Thelines help visualize the perspective warping that will take place once the Transform button is clicked in thePerspective Transform dialog. The perspective transform allows each of the four corners of the layer to beindependently repositioned. The resulting image is warped to a general quadrilateral. Figure 2.29(c) showsthe result of applying the perspective transform specified by the grid shown in Figure 2.29(a).

It should be noted that all the transforms can be used in conjunction with the Transform Lock option of thePaths dialog. This is extremely useful and is discussed in more detail in Section 3.4.1. A relevant example isshown in Section 7.2

2.7 Combining Layers

It is often necessary to combine several layers into one. This is particularly useful prior to saving an imageto a non-GIMP format such as JPEG or GIF. There are two ways of combining layers in the GIMP. Themethod to use depends on the final use of the resulting image.

2.7.1 Merging

It is possible to merge a subset of layers from an image into a single layer. This is accomplished bychoosing Merge Visible Layers from the Layers menu or by simply typing C-m in the image window.Alternatively, it is sometimes convenient to merge just two adjacent layers in the layer stack. This can bedone with Merge Down, found in the Layers menu. The use of this function merges the active layer with thenext visible layer down in the stack. Merge Down can be conveniently invoked by typing C-S-m in theLayers dialog. A nice use of Merge Down is illustrated in Section 9.1.4.

2.7.2 Flattening

The function Flatten Image, found in the Layers menu, is an alternative to Merge Visible Layers. Thisfunction merges all the layers regardless of their visibility in the image window. In addition, Flatten Imageapplies all the layer masks to their respective layers (for more on layer masks, see Section 4.2) and deletesany remaining alpha values in the image. In fact, Flatten Image is the only function in the GIMP that canremove the alpha channel from an image. Channel masks, however, are neither applied nor deleted (seeSection 4.1 for more on channel masks). Typically an image is flattened in order to save it in an image

Page 45: Grokking thegimp

format that does not support layers or transparency. The JPEG format is an example of this.

2.8 Common Problems and Frequently Asked Questions

Layers can be tricky, and it is sometimes possible to run into what seem like incomprehensible difficultieswhile using them. The following list of problems addresses some common difficulties with layers. In anutshell, the information in the Layers dialog almost always contains the solutions to these problems.

� I am trying to draw, paint, select, or apply some other operation on the image window, andrepeated efforts just don't seem to produce any results. What's going on?

GIMP operations are applied to the active layer. A common problem with layers is that the activelayer is not visible. It is possible that the active layer is blocked by layers above it or that the visibilityof the active layer is not turned on. To solve the problem, make sure that the Eye icon of the activelayer is on, and turn off the Eye icon of the layers above it.

� I am trying to paint in a transparent part of a layer, and I am getting no results. Why?

If you are trying to draw or paint on a transparent part of a layer, and nothing seems to leave amark, the problem is that the Keep Trans. button is on in the Layers dialog. Toggle this button offand your problem will...disappear.

� I want to add a layer mask to my image, but it is grayed out in the Layers menu. Why isn'tthis option available?

Background layers and flattened images (see Section 2.7.2) have no alpha channels and so cannothave a layer mask. This problem is easily solved, though, by applying the Add Alpha Channel function from the Layers menu.

� The top layer of my image is labeled Floating Selection, all my other layers are grayed out,and I can't make any of my layers active except the top one. What's wrong?

A floating selection disables all the other layers until it is anchored to a new layer or to the lastactive layer. To anchor to a new layer choose New Layer from the Layers menu or click on the NewLayer button in the Layers dialog. To anchor to the previously active layer, choose Anchor Layer from the Layers menu, or type C-h in the image or dialog window, or click on the Anchor button inthe Layers dialog.

� I saved a finished project's image to disk, but when I try to view the saved image in anotherimage display program, it's missing elements and it doesn't look like the one I saved. Why isthis?

Not all image formats support layers or transparency (JPEG, is one example). For finished projectsthat are saved to formats supporting alpha channels, use the Merge Visible Layers function from theLayers menu before saving. If alpha is not supported, use Flatten Image from the Layers menuinstead. Also, read the next item.

� I spent hours working on an image with multiple layers, channel masks, layer masks, andpaths and then saved it. But when I tried to reload my image back into the GIMP, everythingbut a single layer was gone! What happened!?

Work in progress and finished projects should be saved in the GIMP's native XCF format. This isthe only format that saves all the information about layers, masks, and paths