{"id":739,"date":"2016-08-15T07:29:28","date_gmt":"2016-08-15T05:29:28","guid":{"rendered":"https:\/\/www.kurokesu.com\/main\/?p=739"},"modified":"2016-09-01T20:39:32","modified_gmt":"2016-09-01T18:39:32","slug":"unusual-tasks-with-images-stacking-pictures","status":"publish","type":"post","link":"https:\/\/www.kurokesu.com\/main\/2016\/08\/15\/unusual-tasks-with-images-stacking-pictures\/","title":{"rendered":"Unusual tasks with images \u2013 stacking pictures"},"content":{"rendered":"<p style=\"text-align: justify;\"><a href=\"https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2016\/08\/stack_r.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-744 size-medium\" src=\"https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2016\/08\/stack_r-300x85.jpg\" alt=\"stack_r\" width=\"300\" height=\"85\" srcset=\"https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2016\/08\/stack_r-300x85.jpg 300w, https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2016\/08\/stack_r-768x218.jpg 768w, https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2016\/08\/stack_r-1024x291.jpg 1024w, https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2016\/08\/stack_r.jpg 1500w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a>Stacking images always has been a favorite topic for astro or timelapse photographers. In most cases computational photography opens complete new dimension to taking pictures and acquiring awesome results. There are countless commercial software packages with some advantages or limitations. My mind about simple tasks has always been on DIY side &#8211; I think it is not worth purchasing one when you can make it by yourself. Also besides building working tool you have a chance of learning something new.<\/p>\n<h3 style=\"text-align: justify;\">Blending modes<\/h3>\n<p style=\"text-align: justify;\">There are two mostly used modes of stacking:<\/p>\n<ul>\n<li style=\"text-align: justify;\">Averaging &#8211; is good for getting rid of sensor noise and taking simulated long exposure photos<\/li>\n<li style=\"text-align: justify;\">Brighten &#8211; is used to get persistent view of moving bright object (for example star trails)<\/li>\n<li style=\"text-align: justify;\">Stack &#8211; sum all pixels (good to make picture lighter)<\/li>\n<\/ul>\n<p>Others are not so popular, but also worth mentioning:<\/p>\n<ul>\n<li>Darken &#8211; opposite to brighten<\/li>\n<li>Stack \/ Average mix<\/li>\n<\/ul>\n<h3>Examples<\/h3>\n<p style=\"text-align: justify;\">Different image set&#8217;s require different stacking modes. Result will probably require additional post processing. Below are few sample pictures made with Python script(s) provided below. To illustrate some examples I will be using images captured by stationary time-lapse cameras.<\/p>\n<h4>Brighten<\/h4>\n<p style=\"text-align: justify;\">Brighten picture is perfect algorithm to make\u00a0 star trails visible.<\/p>\n<p style=\"text-align: justify;\">Tip: by capturing individual frames don&#8217;t not to leave gaps between frames and use long exposure. Image on the right was combined from about 2500 frames.<\/p>\n<div id=\"attachment_761\" style=\"width: 610px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2016\/08\/star_r.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-761\" class=\"wp-image-761\" src=\"https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2016\/08\/star_r.jpg\" alt=\"star_r\" width=\"600\" height=\"170\" srcset=\"https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2016\/08\/star_r.jpg 1500w, https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2016\/08\/star_r-300x85.jpg 300w, https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2016\/08\/star_r-768x217.jpg 768w, https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2016\/08\/star_r-1024x289.jpg 1024w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><p id=\"caption-attachment-761\" class=\"wp-caption-text\">Brightest pixel averaging example of star trails<\/p><\/div>\n<h4>Average<\/h4>\n<p style=\"text-align: justify;\">Usually this mode is used to reduce image random noise. Naturally it averages everything, so there are rare cases when it is being used as noise reduction algorithm. But if light conditions are bad and ISO is boosted there are some scenes (landscape, forensic, etc) when it might be helpful.<\/p>\n<div id=\"attachment_762\" style=\"width: 610px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2016\/08\/noise2.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-762\" class=\"wp-image-762\" src=\"https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2016\/08\/noise2.jpg\" alt=\"noise2\" width=\"600\" height=\"202\" srcset=\"https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2016\/08\/noise2.jpg 1000w, https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2016\/08\/noise2-300x101.jpg 300w, https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2016\/08\/noise2-768x258.jpg 768w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><p id=\"caption-attachment-762\" class=\"wp-caption-text\">Image noise cleaning by averaging frames<\/p><\/div>\n<p style=\"text-align: justify;\">Also averaging feature comes handy when you wish to clean picture from random objects like pedestrians or cars.<\/p>\n<div id=\"attachment_770\" style=\"width: 610px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2016\/08\/avg_r.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-770\" class=\"wp-image-770\" src=\"https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2016\/08\/avg_r.jpg\" width=\"600\" height=\"200\" srcset=\"https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2016\/08\/avg_r.jpg 1500w, https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2016\/08\/avg_r-300x100.jpg 300w, https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2016\/08\/avg_r-768x256.jpg 768w, https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2016\/08\/avg_r-1024x341.jpg 1024w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><p id=\"caption-attachment-770\" class=\"wp-caption-text\">Making empty city by averaging frames<\/p><\/div>\n<h4>Sum<\/h4>\n<p style=\"text-align: justify;\">You wound not believe how much information can be revealed from dark areas.<\/p>\n<div id=\"attachment_765\" style=\"width: 610px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2016\/08\/sum_r.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-765\" class=\"wp-image-765\" src=\"https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2016\/08\/sum_r.jpg\" alt=\"sum_r\" width=\"600\" height=\"225\" srcset=\"https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2016\/08\/sum_r.jpg 1500w, https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2016\/08\/sum_r-300x112.jpg 300w, https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2016\/08\/sum_r-768x288.jpg 768w, https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2016\/08\/sum_r-1024x384.jpg 1024w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><p id=\"caption-attachment-765\" class=\"wp-caption-text\">Summing pixels to reveal black areas<\/p><\/div>\n<p style=\"text-align: justify;\">This example is received from 43 DSLR frames. Animation is made by altering\u00a0 ration for each frame and stacking them into <a href=\"https:\/\/www.kurokesu.com\/main\/2016\/07\/14\/making-animated-gifs\/\">animated gif<\/a>.<\/p>\n<div id=\"attachment_777\" style=\"width: 610px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2016\/08\/2015-07-05-21-20-07.768482.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-777\" class=\"wp-image-777\" src=\"https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2016\/08\/2015-07-05-21-20-07.768482-1024x683.jpg\" alt=\"2015-07-05-21-20-07.768482\" width=\"600\" height=\"400\" srcset=\"https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2016\/08\/2015-07-05-21-20-07.768482-1024x683.jpg 1024w, https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2016\/08\/2015-07-05-21-20-07.768482-300x200.jpg 300w, https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2016\/08\/2015-07-05-21-20-07.768482-768x512.jpg 768w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><p id=\"caption-attachment-777\" class=\"wp-caption-text\">Original frame from camera<\/p><\/div>\n<div id=\"attachment_776\" style=\"width: 610px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2016\/08\/stack4.gif\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-776\" class=\"wp-image-776 size-full\" src=\"https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2016\/08\/stack4.gif\" alt=\"stack4\" width=\"600\" height=\"400\" \/><\/a><p id=\"caption-attachment-776\" class=\"wp-caption-text\">brighness_divide effect on final result. Distorted sky is due to limitation of GIF file format &#8211; it can&#8217;t provide enough halftones.<\/p><\/div>\n<h3>Code<\/h3>\n<p style=\"text-align: justify;\">Python scripts use standard modules (fnmatch, numpy, PIL, tqdm) that can be installed with pip &#8211; for example:<\/p>\n<pre>pip install tqdm<\/pre>\n<div id=\"attachment_755\" style=\"width: 609px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2016\/08\/screenshot.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-755\" class=\"wp-image-755\" src=\"https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2016\/08\/screenshot.png\" alt=\"screenshot\" width=\"599\" height=\"178\" srcset=\"https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2016\/08\/screenshot.png 1177w, https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2016\/08\/screenshot-300x89.png 300w, https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2016\/08\/screenshot-768x228.png 768w, https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2016\/08\/screenshot-1024x305.png 1024w\" sizes=\"auto, (max-width: 599px) 100vw, 599px\" \/><\/a><p id=\"caption-attachment-755\" class=\"wp-caption-text\">Script provides nice progress bar with remaining time estimation<\/p><\/div>\n<p><script src=\"https:\/\/gist.github.com\/Lukse\/f7ca2cb00e3cfccebc0fbf9320bc0f44.js\"><\/script><\/p>\n<p><script src=\"https:\/\/gist.github.com\/Lukse\/158c8ddad5c2f451812d4fafa08b7957.js\"><\/script><\/p>\n<p><script src=\"https:\/\/gist.github.com\/Lukse\/681d02db3b10092d231cdbf45b20a389.js\"><\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Stacking images always has been a favorite topic for astro or timelapse photographers. In most cases computational photography opens complete new dimension to taking pictures and acquiring awesome results. There are countless commercial software packages with some advantages or limitations. My mind about simple tasks has always been on DIY side &#8211; I think it [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":744,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[157,153],"tags":[101,97,93,96,103,94,68,95,91,100,102,49,92,99,98,90],"class_list":["post-739","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-how-to","category-projects","tag-animated-gif","tag-average","tag-brighten","tag-code","tag-computational-photography","tag-darken","tag-diy","tag-github","tag-image","tag-image-processing","tag-noise","tag-python","tag-stack","tag-star-tarails","tag-sum","tag-time-lapse"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2016\/08\/stack_r.jpg","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p6VSmB-bV","_links":{"self":[{"href":"https:\/\/www.kurokesu.com\/main\/wp-json\/wp\/v2\/posts\/739","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kurokesu.com\/main\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kurokesu.com\/main\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kurokesu.com\/main\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kurokesu.com\/main\/wp-json\/wp\/v2\/comments?post=739"}],"version-history":[{"count":33,"href":"https:\/\/www.kurokesu.com\/main\/wp-json\/wp\/v2\/posts\/739\/revisions"}],"predecessor-version":[{"id":788,"href":"https:\/\/www.kurokesu.com\/main\/wp-json\/wp\/v2\/posts\/739\/revisions\/788"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.kurokesu.com\/main\/wp-json\/wp\/v2\/media\/744"}],"wp:attachment":[{"href":"https:\/\/www.kurokesu.com\/main\/wp-json\/wp\/v2\/media?parent=739"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kurokesu.com\/main\/wp-json\/wp\/v2\/categories?post=739"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kurokesu.com\/main\/wp-json\/wp\/v2\/tags?post=739"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}