Announcement

Collapse
No announcement yet.

Layers using Overlay

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Layers using Overlay

    I had the need to overlay an image containing a line drawing plat of property lines onto a Google Maps Satellite view.

    While I knew that this would be possible in software that supported "layers" IrfanView has been my primary image editor since Irfan released it in 1996 and it is now my only image editor and I wanted to see if it might be possible to figure out how to meet this need in IrfanView. (I have to believe that doing this or similar things would be of value to other IrfanView users, so, I'm taking the time to post what I learned generating this image.)

    Bhikkhu Pesala gave me the starting point on the forum by pointing me to the menu option
    Edit/InsertOverlay...an option that I had never noticed before.

    Here is a sample image of the result.

    Click image for larger version

Name:	ANLandOverlay.jpg
Views:	1
Size:	101.0 KB
ID:	85381

    PNG files seem to work best for transparency, so, I opened the PDF file containing the plats with property lines, then reduced the color to "2" and cropped the image as close as possible to the image I wanted to overlay.

    Since black lines won't work well as an overlay on a dark green Google Maps Satellite view, I replaced "black" with "orange" in this example.*
    (Remember that changing a color increases the color depth to at least 16)

    Then Save AS the PDF file as a PNG file
    Select the white background as the transparent color
    (Tip, this full resolution PNG file will be used as a source file and NOT the final overlay file)

    Now, the math part.

    Open the image that will be the "base" image that the overlay will be superimposed on top of.

    IrfanView's current "overlay" process only uses the top left corner of the overlay file to position the overlay onto the base image.

    You can position the top left corner of the overlay image by pulling a selection box on the base image and setting the top left corner at the point on the base image to match the top left corner of the overlay image.

    Since there is no way to "size" the overlay image when it is applied over the base image (click "preview" in the overlay dialog to see these issues) it is necessary to resize the overlay file in advance to match the area on the base image where you want to place the overlay image.

    To do this, you will need to determine two points on the base image that will match the size of the entire overlay image itself.

    Starting at the exact point of the top left location of the overlay image, pull a box that approximates the size of the overlay.

    Next, resize either the right side or bottom of the selection box exactly where you want the overlay to end.

    Find the dimensions of the box you just pulled (look in IrfanView's top border of the base image window) and note either the horizontal or vertical size in pixels.
    • Open the overlay image, then
    • imageImage/ResizeResample
    • Check "Preserve Aspect Ratio"
    • Enter either the horizontal or vertical pixel value in the appropriate box
    • Click OK
    • Save As (Use a different filename, don't overwrite this file)

    • Switch to or Open the base image file
    • Pull a rectangle positioning the top left corner as accurately as possible
    • Edit/InsertOverlay...
    • Set Transparency to "0"
    • Enter/Select Filename of Overlay file
    • Click Preview


    "Preview" will allow you to verify the position and scaling of the overlay so you can go back and make changes before altering the base image.

    SaveAs the resulting file under a different filename so that the source base image file remains available if you need to make changes.

    Hope this is of value to someone,
    Beverly Howard
Working...
X