{"id":1357,"date":"2016-02-05T13:00:15","date_gmt":"2016-02-05T12:00:15","guid":{"rendered":"https:\/\/www.skeptic.de\/blog\/kv\/?p=1357"},"modified":"2016-11-18T19:04:53","modified_gmt":"2016-11-18T18:04:53","slug":"technical-epilogue-on-the-purple-fringe","status":"publish","type":"post","link":"https:\/\/leetraynor.com\/blog.multi\/kiwi5\/?p=1357","title":{"rendered":"Technical Epilogue: On the Purple Fringe"},"content":{"rendered":"<h4 class=\"page_index\">\n<ul>\n<li><a href=\"#methods\">Methods<\/a><\/li>\n<li><a href=\"#comparison\">Comparison of the Results<\/a><\/li>\n<li><a href=\"#test\">Test<\/a><\/li>\n<li><a href=\"#recommendations\">Recommendations and Scripts<\/a><\/li>\n<\/ul>\n<\/h4>\n<p class=\"opener\">A problem that arises in high contrast photography is purple fringing due to short wavelength light being refracted around a dark\/bright transition. This is different from chromatic aberration of the lens which results in green\/purple fringing at such transitions. The latter can be largely removed by resizing the red and blue channels. The classical fix for pure purple fringing has been to use <a href=\"https:\/\/www.farcrydesign.com\/GIMP\/PurpleFringe.html\" target=\"new\">Darla&#8217;s Purple Fringe<\/a> script for the GIMP, but the results are rather modest and require fiddling with afterwards, as shown in these two images:<\/p>\n<table>\n<tr>\n<td><figure id=\"attachment_1355\" aria-describedby=\"caption-attachment-1355\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2015\/11\/Waikaremoana-original.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2015\/11\/Waikaremoana-original-300x227.jpg\" alt=\"Lake Waikaremoana\" width=\"300\" height=\"227\" class=\"size-medium wp-image-1355\" srcset=\"https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2015\/11\/Waikaremoana-original-300x227.jpg 300w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2015\/11\/Waikaremoana-original-1024x773.jpg 1024w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2015\/11\/Waikaremoana-original.jpg 1200w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-1355\" class=\"wp-caption-text\">Fig. 1: Lake Waikaremoana, March 20, high contrast snapshot with substantial purple fringing<\/figcaption><\/figure><\/td>\n<td><figure id=\"attachment_1356\" aria-describedby=\"caption-attachment-1356\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2015\/11\/Waikaremoana-Darla-PF.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2015\/11\/Waikaremoana-Darla-PF-300x227.jpg\" alt=\"Waikaremoana Darla PF\" width=\"300\" height=\"227\" class=\"size-medium wp-image-1356\" srcset=\"https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2015\/11\/Waikaremoana-Darla-PF-300x227.jpg 300w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2015\/11\/Waikaremoana-Darla-PF-1024x773.jpg 1024w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2015\/11\/Waikaremoana-Darla-PF.jpg 1200w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-1356\" class=\"wp-caption-text\">Fig. 2: Purple Fringe reduction with Darla&#8217;s Purple Fringe for GIMP. Note residual fringing<\/figcaption><\/figure><\/td>\n<\/tr>\n<\/table>\n<p><!--more--><\/p>\n<p>I also wanted to port the effect to ImageMagick for ease in automating the process, so by understanding what Darla&#8217;s Purple Fringe was doing, I have tried to come up with an improvement. Darla has the disadvantage of &#8220;robbing&#8221; the edges, i.e. brightening them, leading to loss of detail.<\/p>\n<h4 class=\"special_section\" id=\"methods\">Methods<\/h4>\n<p>Finding edges and decolouring them was not the problem. The GIMP has a neat tool for decolouring not just red, green or blue channels, but also the admixtures cyan, yellow and magenta, although the method by which it achieves this is a little esoteric. This proved to be impossible to replicate exactly in ImageMagick, although on further consideration this should not have been worth the bother, because all that is really needed is to replace the areas of purple fringes with a more or less completely greyscale image.<\/p>\n<p>The <em>green<\/em> channel of the image (here as a proxy for the negative of the magenta channel) can be separated from the rest and multiplied by an edged image to give a mask which represents the purple fringes, and these can be replaced by a greyscale image. However, the effect is modest at best, and limited only to the immediate edges, and this cannot be remedied by increasing the edge width by blurring. Furthermore the edges are lost by brightening.<\/p>\n<table>\n<tr>\n<td><figure id=\"attachment_1366\" aria-describedby=\"caption-attachment-1366\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2015\/11\/PurpleFringe_Ex1.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2015\/11\/PurpleFringe_Ex1-300x227.jpg\" alt=\"PurpleFringe_Ex1\" width=\"300\" height=\"227\" class=\"size-medium wp-image-1366\" srcset=\"https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2015\/11\/PurpleFringe_Ex1-300x227.jpg 300w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2015\/11\/PurpleFringe_Ex1-1024x773.jpg 1024w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2015\/11\/PurpleFringe_Ex1.jpg 1200w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-1366\" class=\"wp-caption-text\">Fig. 3: Mask showing fringes in the magenta channel of the image<\/figcaption><\/figure><\/td>\n<td><figure id=\"attachment_1367\" aria-describedby=\"caption-attachment-1367\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2015\/11\/PurpleFringe_Ex2.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2015\/11\/PurpleFringe_Ex2-300x227.jpg\" alt=\"PurpleFringe_Ex2\" width=\"300\" height=\"227\" class=\"size-medium wp-image-1367\" srcset=\"https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2015\/11\/PurpleFringe_Ex2-300x227.jpg 300w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2015\/11\/PurpleFringe_Ex2-1024x773.jpg 1024w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2015\/11\/PurpleFringe_Ex2.jpg 1200w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-1367\" class=\"wp-caption-text\">Fig. 3: Apply a greyscale image through the mask results in greyscaled <em>edges<\/em>, but also removes colour from bright areas (Script #1)<\/figcaption><\/figure><\/td>\n<\/tr>\n<\/table>\n<p>Another tactic would be to more closely represent the magenta areas of medium intensity and hope to find their (wider) edges. Now we have to be careful about designing a mask to target those areas where the magenta value is high, but obviously not those areas of brightest colour (which would be greens, yellows, pinks, etc.). This can be done by isolating the green channel and subtracting a greyscale image from it to give a close approximation of the magenta channel negative (Script #2):<\/p>\n<table>\n<tr>\n<td><figure id=\"attachment_1371\" aria-describedby=\"caption-attachment-1371\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2015\/11\/PurpleFringe_Ex3.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2015\/11\/PurpleFringe_Ex3-300x227.jpg\" alt=\"PurpleFringe_Ex3\" width=\"300\" height=\"227\" class=\"size-medium wp-image-1371\" srcset=\"https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2015\/11\/PurpleFringe_Ex3-300x227.jpg 300w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2015\/11\/PurpleFringe_Ex3-1024x773.jpg 1024w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2015\/11\/PurpleFringe_Ex3.jpg 1200w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-1371\" class=\"wp-caption-text\">Fig. 5: Subtracting a grey image from the green channel gives a hint that the purple areas are being targeted<\/figcaption><\/figure><\/td>\n<td><figure id=\"attachment_1370\" aria-describedby=\"caption-attachment-1370\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2015\/11\/PurpleFringe_Ex4.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2015\/11\/PurpleFringe_Ex4-300x227.jpg\" alt=\"PurpleFringe_Ex4\" width=\"300\" height=\"227\" class=\"size-medium wp-image-1370\" srcset=\"https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2015\/11\/PurpleFringe_Ex4-300x227.jpg 300w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2015\/11\/PurpleFringe_Ex4-1024x773.jpg 1024w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2015\/11\/PurpleFringe_Ex4.jpg 1200w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-1370\" class=\"wp-caption-text\">Fig. 6: Applying a low threshold (approx. quantum range \/ 16) shows that these are indeed the worst areas of purple fringe<\/figcaption><\/figure><\/td>\n<\/tr>\n<\/table>\n<p>Now to find a replacement. The first impulse to use just the greyscale image previously used to eliminate the bright areas of the image by subtracting them from the green channel turns out to be not that bad (Script #3). However, there is a distinct lack of colour in those areas where the mask is fairly densely white (e.g. the upper left corner).<\/p>\n<table>\n<tr>\n<td><figure id=\"attachment_1375\" aria-describedby=\"caption-attachment-1375\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2015\/11\/PurpleFringe_Ex5.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2015\/11\/PurpleFringe_Ex5-300x227.jpg\" alt=\"PurpleFringe_Ex5\" width=\"300\" height=\"227\" class=\"size-medium wp-image-1375\" srcset=\"https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2015\/11\/PurpleFringe_Ex5-300x227.jpg 300w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2015\/11\/PurpleFringe_Ex5-1024x773.jpg 1024w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2015\/11\/PurpleFringe_Ex5.jpg 1200w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-1375\" class=\"wp-caption-text\">Fig. 7: Greyscale image used in this sequence, and applied here to replace the purple areas identified in the previous step<\/figcaption><\/figure><\/td>\n<td><figure id=\"attachment_1374\" aria-describedby=\"caption-attachment-1374\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2015\/11\/PurpleFringe_Ex6.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2015\/11\/PurpleFringe_Ex6-300x227.jpg\" alt=\"PurpleFringe_Ex6\" width=\"300\" height=\"227\" class=\"size-medium wp-image-1374\" srcset=\"https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2015\/11\/PurpleFringe_Ex6-300x227.jpg 300w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2015\/11\/PurpleFringe_Ex6-1024x773.jpg 1024w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2015\/11\/PurpleFringe_Ex6.jpg 1200w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-1374\" class=\"wp-caption-text\">Fig. 8: Image resulting from replacing the purple areas with the corresponding areas from the greyscale. Note the almost complete lack of colour in the upper left corner<\/figcaption><\/figure><\/td>\n<\/tr>\n<\/table>\n<p>Was there another possibility? Compositing Fig. 5 directly onto the both original red and blue channels using the <em>&#8220;difference&#8221;<\/em> operator results in an image which is remarkably free from purple fringing, with most of the other colour still retained \u2013 again compare the upper left corner for the blue sky. This is a remarkably simple script (Script #4, Fig. 9). This method darkens the previously purple areas, whereas adding Fig. 5 to the green channel washes them out (Fig. 10).<\/p>\n<table>\n<tr>\n<td><figure id=\"attachment_1419\" aria-describedby=\"caption-attachment-1419\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex7.jpg\" rel=\"attachment wp-att-1419\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex7-300x227.jpg\" alt=\"PF_Ex7\" width=\"300\" height=\"227\" class=\"size-medium wp-image-1419\" srcset=\"https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex7-300x227.jpg 300w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex7-768x580.jpg 768w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex7-1024x773.jpg 1024w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex7.jpg 1200w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-1419\" class=\"wp-caption-text\">Fig. 9: Using the very simple Script #4, most of the purple areas can be removed, leaving only negligible fringing without affecting the rest of the colour<\/figcaption><\/figure><\/td>\n<td><figure id=\"attachment_1430\" aria-describedby=\"caption-attachment-1430\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex8.jpg\" rel=\"attachment wp-att-1430\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex8-300x227.jpg\" alt=\"PurpleFringe_Ex8\" width=\"300\" height=\"227\" class=\"size-medium wp-image-1430\" srcset=\"https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex8-300x227.jpg 300w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex8-768x580.jpg 768w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex8-1024x773.jpg 1024w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex8.jpg 1200w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-1430\" class=\"wp-caption-text\">Fig. 10: Adding areas where green is underrepresented to the green channel washes out details in the fringes<\/figcaption><\/figure><\/td>\n<\/tr>\n<\/table>\n<p>That brings us up to about 95% complete. Now the problem has to be addressed that the current script alters <em>areas<\/em> of red, blue and magenta and not just the edges. Starting with the image in Fig. 5, edges are detected (Fig. 11), this edged image blurred a little, the threshold stretched and this image used as a layer mask for determining which areas of the decoloured image (Fig. 10) replace the original (Fig. 12). To estimate the threshold stretch some values about the number and distribution of the edge (white\/grey) pixels is needed. This means that similar results should be obtained with differing amounts of edges.<\/p>\n<table>\n<tr>\n<td><figure id=\"attachment_1429\" aria-describedby=\"caption-attachment-1429\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex9.jpg\" rel=\"attachment wp-att-1429\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex9-300x227.jpg\" alt=\"PurpleFringe_Ex9\" width=\"300\" height=\"227\" class=\"size-medium wp-image-1429\" srcset=\"https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex9-300x227.jpg 300w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex9-768x580.jpg 768w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex9-1024x773.jpg 1024w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex9.jpg 1200w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-1429\" class=\"wp-caption-text\">Fig. 11: Layer mask for decolouring as edges of the magenta areas before blurring and contrast-stretching<\/figcaption><\/figure><\/td>\n<td><figure id=\"attachment_1428\" aria-describedby=\"caption-attachment-1428\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex10.jpg\" rel=\"attachment wp-att-1428\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex10-300x227.jpg\" alt=\"PurpleFringe_Ex10\" width=\"300\" height=\"227\" class=\"size-medium wp-image-1428\" srcset=\"https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex10-300x227.jpg 300w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex10-768x580.jpg 768w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex10-1024x773.jpg 1024w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex10.jpg 1200w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-1428\" class=\"wp-caption-text\">Fig. 12: Defringed image<\/figcaption><\/figure><\/td>\n<\/tr>\n<\/table>\n<h4 class=\"special_section\" id=\"comparison\">Comparison of the results<\/h4>\n<p>To compare the images before-and-after, the images were stacked in the GIMP and the upper (processed) image layer was represented in the grain-extract mode, which subtracts the lower image from the higher image and adds 50% greyscale to all pixels. The colours removed are shown clearly on the grey background (Fig. 13-16).<\/p>\n<p>One major difference between Darla and the current method is obvious from the comparison of the two methods (Fig. 15) &#8221; Darla removes the purple edges in a similar fashion to the method in Fig. 10. In other words, the current method preserves or restores more dark areas than Darla does. Superimposing Darla&#8217;s method on the image produced here results in small tonal changes in blues and reds.<\/p>\n<table>\n<tr>\n<td><figure id=\"attachment_1427\" aria-describedby=\"caption-attachment-1427\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex11.jpg\" rel=\"attachment wp-att-1427\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex11-300x227.jpg\" alt=\"PurpleFringe_Ex11\" width=\"300\" height=\"227\" class=\"size-medium wp-image-1427\" srcset=\"https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex11-300x227.jpg 300w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex11-768x580.jpg 768w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex11-1024x773.jpg 1024w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex11.jpg 1200w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-1427\" class=\"wp-caption-text\">Fig. 13: Comparison by grain-extraction between original and defringed image. Coloured areas show which colours have been removed<\/figcaption><\/figure><\/td>\n<td><figure id=\"attachment_1426\" aria-describedby=\"caption-attachment-1426\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex12.jpg\" rel=\"attachment wp-att-1426\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex12-300x227.jpg\" alt=\"PurpleFringe_Ex12\" width=\"300\" height=\"227\" class=\"size-medium wp-image-1426\" srcset=\"https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex12-300x227.jpg 300w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex12-768x580.jpg 768w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex12-1024x773.jpg 1024w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex12.jpg 1200w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-1426\" class=\"wp-caption-text\">Fig. 14: Effect of Darla&#8217;s Purple Fringe on the original<\/figcaption><\/figure><\/td>\n<\/tr>\n<tr>\n<td><figure id=\"attachment_1425\" aria-describedby=\"caption-attachment-1425\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex13.jpg\" rel=\"attachment wp-att-1425\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex13-300x227.jpg\" alt=\"PurpleFringe_Ex13\" width=\"300\" height=\"227\" class=\"size-medium wp-image-1425\" srcset=\"https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex13-300x227.jpg 300w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex13-768x580.jpg 768w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex13-1024x773.jpg 1024w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex13.jpg 1200w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-1425\" class=\"wp-caption-text\">Fig. 15: Direct comparison between the defringed image (Fig. 12) and Darla&#8217;s Purple Fringe (Fig. 2)<\/figcaption><\/figure><\/td>\n<td><figure id=\"attachment_1424\" aria-describedby=\"caption-attachment-1424\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex14.jpg\" rel=\"attachment wp-att-1424\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex14-300x227.jpg\" alt=\"PurpleFringe_Ex14\" width=\"300\" height=\"227\" class=\"size-medium wp-image-1424\" srcset=\"https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex14-300x227.jpg 300w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex14-768x580.jpg 768w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex14-1024x773.jpg 1024w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex14.jpg 1200w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-1424\" class=\"wp-caption-text\">Fig. 16: Compound effect of defringing with script #5 followed by Darla&#8217;s Purple fringe, comparison with original<\/figcaption><\/figure><\/td>\n<\/tr>\n<\/table>\n<h4 class=\"special_section\" id=\"test\">Test<\/h4>\n<p>A good test case is the image &#8220;No Public Access&#8221; (Fig. 17) which has large red areas. The decoloured image (Fig. 18) shows a major undesirable hue shift. However, when this shift is restricted to the edges it is noticeable only as a soft outlining (Fig. 19). The effect is somewhat less noticeable by using Darla&#8217;s Purple Fringe, but it is still present (Fig. 20).<\/p>\n<table>\n<tr>\n<td><figure id=\"attachment_1423\" aria-describedby=\"caption-attachment-1423\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex15.jpg\" rel=\"attachment wp-att-1423\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex15-300x225.jpg\" alt=\"PurpleFringe_Ex15\" width=\"300\" height=\"225\" class=\"size-medium wp-image-1423\" srcset=\"https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex15-300x225.jpg 300w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex15-768x576.jpg 768w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex15-1024x768.jpg 1024w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex15.jpg 1200w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-1423\" class=\"wp-caption-text\">Fig. 17: No Public Access &#8211; original image<\/figcaption><\/figure><\/td>\n<td><figure id=\"attachment_1421\" aria-describedby=\"caption-attachment-1421\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex16.jpg\" rel=\"attachment wp-att-1421\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex16-300x225.jpg\" alt=\"PurpleFringe_Ex16\" width=\"300\" height=\"225\" class=\"size-medium wp-image-1421\" srcset=\"https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex16-300x225.jpg 300w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex16-768x576.jpg 768w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex16-1024x768.jpg 1024w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex16.jpg 1200w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-1421\" class=\"wp-caption-text\">Fig. 18: Decoloured image showing hue shift towards blue<\/figcaption><\/figure><\/td>\n<\/tr>\n<tr>\n<td><figure id=\"attachment_1422\" aria-describedby=\"caption-attachment-1422\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex17.jpg\" rel=\"attachment wp-att-1422\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex17-300x225.jpg\" alt=\"PurpleFringe_Ex17\" width=\"300\" height=\"225\" class=\"size-medium wp-image-1422\" srcset=\"https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex17-300x225.jpg 300w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex17-768x576.jpg 768w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex17-1024x768.jpg 1024w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex17.jpg 1200w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-1422\" class=\"wp-caption-text\">Fig. 19: Defringed image (Script #5), noticeable outlining of red areas<\/figcaption><\/figure><\/td>\n<td><figure id=\"attachment_1420\" aria-describedby=\"caption-attachment-1420\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex18.jpg\" rel=\"attachment wp-att-1420\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex18-300x225.jpg\" alt=\"PurpleFringe_Ex18\" width=\"300\" height=\"225\" class=\"size-medium wp-image-1420\" srcset=\"https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex18-300x225.jpg 300w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex18-768x576.jpg 768w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex18-1024x768.jpg 1024w, https:\/\/leetraynor.com\/blog.multi\/kiwi5\/wp-content\/uploads\/sites\/5\/2016\/02\/PurpleFringe_Ex18.jpg 1200w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-1420\" class=\"wp-caption-text\">Fig. 20: Image after Darla&#8217;s Purple fringe. Some outlining is visible<\/figcaption><\/figure><\/td>\n<\/tr>\n<\/table>\n<h4 class=\"special_section\" id=\"recommendations\">Recommendations and Scripts<\/h4>\n<p>Removal of the Purple Fringe by Script #5 should be performed after removal of general chromatic aberration (green\/purple fringing) but before colour\/hue manipulation.<\/p>\n<p>Images with bright red, blue or purple subjects may experience noticeable outlining of the coloured areas.<\/p>\n<p>As always: Use at your own risk!<\/p>\n<p>Scripts: <a  data-e-Disable-Page-Transition=\"true\" class=\"download-link\" title=\"Version 1.0\" href=\"https:\/\/leetraynor.com\/blog.multi\/kiwi5?download=1434&amp;tmstv=1776773301\" rel=\"nofollow\" id=\"download-link-1434\" data-redirect=\"false\" >\n\tDePurple for Imagick\t(1475 downloads\t)\n<\/a>\n<br \/>\n<script>blog_id = 'K5_DePurple';<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Methods Comparison of the Results Test Recommendations and Scripts A problem that arises in high contrast photography is purple fringing due to short wavelength light being refracted around a dark\/bright transition. This is different from chromatic aberration of the lens which results in green\/purple fringing at such transitions. The latter can be largely removed by &hellip; <a href=\"https:\/\/leetraynor.com\/blog.multi\/kiwi5\/?p=1357\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Technical Epilogue: On the Purple Fringe<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[381,379,377,378,380],"class_list":["post-1357","post","type-post","status-publish","format-standard","hentry","category-photography","tag-chromatic-aberration","tag-darlas-purple-fringe","tag-gimp","tag-imagemagick","tag-purple-fringe-reduction"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/leetraynor.com\/blog.multi\/kiwi5\/index.php?rest_route=\/wp\/v2\/posts\/1357","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/leetraynor.com\/blog.multi\/kiwi5\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/leetraynor.com\/blog.multi\/kiwi5\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/leetraynor.com\/blog.multi\/kiwi5\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/leetraynor.com\/blog.multi\/kiwi5\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1357"}],"version-history":[{"count":49,"href":"https:\/\/leetraynor.com\/blog.multi\/kiwi5\/index.php?rest_route=\/wp\/v2\/posts\/1357\/revisions"}],"predecessor-version":[{"id":2273,"href":"https:\/\/leetraynor.com\/blog.multi\/kiwi5\/index.php?rest_route=\/wp\/v2\/posts\/1357\/revisions\/2273"}],"wp:attachment":[{"href":"https:\/\/leetraynor.com\/blog.multi\/kiwi5\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1357"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/leetraynor.com\/blog.multi\/kiwi5\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1357"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/leetraynor.com\/blog.multi\/kiwi5\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1357"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}