Page 1 of 1

Merging images into a very large image

Posted: Tue Jan 17, 2017 8:36 pm
by andrew
I am try to merge a number of large and long bitonal TIF images (41,600x 2,000) into a single large image (41,600 x 30,000), using something similar to the following code (x64) of course.

Code: Select all

Dim ofd As New OpenFileDialog
        ofd.Multiselect = True
        Dim itop As Integer = 0
        PrimaryImageID = 0
        If ofd.ShowDialog = DialogResult.OK Then
            For Each fn As String In ofd.FileNames
                If PrimaryImageID = 0 Then
                    PrimaryImageID = Imaging1.CreateGdPictureImageFromFile(fn)
                    itop = Imaging1.GetHeight(PrimaryImageID)
                    Imaging1.SetVerticalResolution(PrimaryImageID, 300)
                    Imaging1.SetHorizontalResolution(PrimaryImageID, 300)
                    TempImageID = Imaging1.CreateGdPictureImageFromFile(fn)
                    Imaging1.AddBorderBottom(PrimaryImageID, Imaging1.GetHeight(TempImageID), Color.White)
                    If Imaging1.GetStat <> GdPicture12.GdPictureStatus.OK Then MsgBox(Imaging1.GetStat.ToString)
                    If Imaging1.GetWidth(TempImageID) > Imaging1.GetWidth(PrimaryImageID) Then Imaging1.AddBorderRight(PrimaryImageID, Imaging1.GetWidth(TempImageID) - Imaging1.GetWidth(PrimaryImageID), Color.White)
                    If Imaging1.GetStat <> GdPicture12.GdPictureStatus.OK Then MsgBox(Imaging1.GetStat.ToString)
                    Imaging1.DrawGdPictureImage(TempImageID, PrimaryImageID, 0, itop - 1, Imaging1.GetWidth(TempImageID), Imaging1.GetHeight(TempImageID), Drawing2D.InterpolationMode.Low)
                    itop = Imaging1.GetHeight(PrimaryImageID)
                End If

                If Imaging1.GetStat <> GdPicture12.GdPictureStatus.OK Then MsgBox(Imaging1.GetStat.ToString)

        End If
after adding the 5th strip, the image is no longer displayable in the viewer (total mem usage of over 4GB), after adding the 6th or 7th the image will not save correctly with a "Generic Error". After adding 9 or 10 strips the GdPicture.Imaging status is out of memory (total mem usage of about 5.0GB) .
MemUsage.PNG (11.53 KiB) Viewed 3589 times
I have a number of the completed large image (41,600 x 30,000) that were produced using another tools kit, and the images open fine, though not in the GDViewer, as we get the same out of memory issue.

My Dev box is running 16GB with 11GB free when starting the application, I have tested the code on production servers with 32/64GB with the same effect.

Any help yo can provide would be greatly appreciated.

- Andrew

Re: Merging images into a very large image

Posted: Mon Apr 01, 2019 1:48 pm
by Gabriela

We are sorry for being such late in answering, but are you experiencing such issues with the current release?
If yes, kindly let us know if you need further assistance.