Skip to main content

Using Paint.NET to Blend Images

Note: this is a repost from my original blog back in 2009. 


clip_image001  clip_image002

Sometimes I need to do a little graphics work, but I do not have Photoshop.  Instead I use a great free tool called Paint.NET.  It is an open source image editing project built with C#.  It has a very rich feature set in many ways similar to Photoshop.  Community plugins are also available.

Like other graphics tools, sometimes you have to figure out the tricks to get things done.  In this case I will be showing one way to seamlessly blend the edges of two photos.  I needed to do this for some scrolling banner images, but there are many other uses for this technique.

First you want to open both images.  Then expand the canvas on the first image in order to fit the second image.  This is done by selecting the “Image” menu item, and then the “Canvas Size” sub item.


Now copy the second image and paste it onto the second image into a new layer.  You can use the “Paste in to New Layer” option under the “Edit” menu.  Move the edge of the second image over the top of the first image.  You will need a good amount of overlap to blend with.  (The “Move Selection” mode is activated by clicking on second item at the top in the bottom right “Tools” bar.)


Now select the gradient tool.  Set the gradient mode to “Transparency Mode”.  Set the Secondary transparency to 0.  Set the Primary transparency to 78 (Note: you may have to experiment with different levels of transparency).


Apply the gradient by clicking and dragging to the right (Note: make sure “Layer 2” is selected.  We are applying the gradient to this layer only).  You may need to redo this a few times to get the proper distance.  Notice that the first image is now bleeding into the second.


There is still one problem left.  Even though the images are somewhat merged there is a distinct line separating them.


One way to deal with this is to apply a blur.  There are many different ways to do this.  Sometimes a “Radial Blur” is best, and other times a “Motion Blur” works better.  It may be necessary to apply multiple blurs.  In this case a radial blur will be applied and then a motion blur (Note: the blurs are only being applied to the semitransparent edge of “Layer 2”).  First select the area to blur.


Blur options are available under the “Effects” menu and then under the “Blur” sub menu.  First apply a radial blur.  Just experiment with the settings until you find something that looks good.  I used the settings below.


After applying the radial blur you will notice that only a slight line is remaining.


Select an area for a motion blur.


Apply a small motion blur.


And finally we have merged and blended image edges.  The image transition is almost seamless.


I hopes this helps someone else trying to do this.  There are probably many other ways to do it.  This is just the approach that I took.


Popular posts from this blog

Using C# to Automate Linear Regression in Excel

Excel has a nice linear regression tool as part of the included Analysis ToolPak add-in.  It is quick and easy to use even for the layperson.
To make sure you have this add-in enabled:
Go to File > Options > Add-insSelect Manage “Excel Add-ins”Click on “Go”Make sure “Analysis ToolPak” is checked
Let’s say we have the following sample data of gas and crude oil prices.

And we want to analyze the relationship crude oil pricing has to gas pricing.  To manually run the regression tool:
Open the “Data” ribbon menuCick “Data Analysis”Select “Regression” in the listClick “Ok” Here are some sample settings for the tool:

This would be the output:

There are many articles out there on how to interpret and use the results of linear regression analysis.  You may want to take note of the R Square value, which indicates how closely your values relate.

Now let’s say you wanted to run a lot of linear regressions or wanted to re-run them every time there is a new data point.  And you are lazy and d…

Online Video Disruption: Blockchain and WebTorrent

So, I thought I had this awesome idea to disrupt the online video market.  A vision of a decentralized video marketplace with self-sustainable incentive structures.  Imagine this mashup: WebTorrent + Blockchain = YouTube Killer.While watching a video you would be sharing it back out, which would greatly reduce the burden of viral videos on central nodes.  Encourage node hosting infrastructure development by giving hosters a small cut of transactions.  Allow a direct relationship and incentive structure between niche content creators and consumers with monetization through microtransactions.  Reward influencers for spreading content.Time to get started, right?  Well, just like many of you that have a lot of ideas, I soon discovered someone else is already working on it. is almost exactly what I had envisioned, and they have some big players behind them.  The primary difference is their approach is completely ad-free.  I understand their reasoning for flipping the script a…