Global Mapper v25.0

Crop images with 4 channels (RGBIR)_white background

kuko
kuko Global Mapper UserTrusted User
edited January 2011 in Technical Support
Hi GM Administrators

I have a problem with the results of cropping some images in 4 channels RGBIR (batch mode) with white background. Once I export the croppped images in mutiband mode the result transform the original white backgound of the images into black background.

Note: The color of the Global Mapper interface is white. The Global mapper software used is version 12.

I have also tried to change quite a few options with no success. Please, could you help me? I don´t know if this is a "bug" or a "error" is the crop images with the mutiband export option but all the results have the background as black. I have also used the bach mode for exporting images with 4 channels but with no crop, and this way we get white background, so It seems that the problems is about the cropping.

Thanks a lot

Kind regards

Jorge

Comments

  • global_mapper
    global_mapper Administrator
    edited January 2011
    Jorge,

    Can you provide one of the images that you are trying to crop? Also, how are you doing the crop in the batch conversion process?

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • kuko
    kuko Global Mapper User Trusted User
    edited January 2011
    Hello Mike

    Thank you so much for your fast answer.

    I will send you a copy of one of my images.

    The method I use is the next:

    1.- I read a shape file with GM and then apply the option "select all features with the digitizer tool"
    2.- Once the step 1 is complete I go to the bach window and there select the option "crop to selected areas" for the image and maintain the full size when cropping.

    3. I put the images for cropping and when GM reads them I choose the option "no" to the question about the extraband of imagery data.

    4.- Input format is geotiff and output format is geotif (raster imagery)

    Kind regards

    Jorge
  • global_mapper
    global_mapper Administrator
    edited January 2011
    Jorge,

    Thank you for the files, I took a a look and found where the background color wasn't being kept for no-data areas in 8-bit multi-band exports. I have placed a new build at http://www.globalmapper.com/global_mapper12.zip with this fixed for you to try. Simply download that file and extract the contents into your existing v12.xx installation folder to give it a try. If you are using the 64-bit v12 version there is a new build at http://www.globalmapper.com/global_mapper12_64bit.zip .

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • kuko
    kuko Global Mapper User Trusted User
    edited January 2011
    Hello again Mike

    I put the new ".dll" and exe files into their folder and now I have just made a test with them. I am sorry to say that your new exe file for GM 12 does not work properly because the 3 first channels (RGB) has been cropped correctly but the alfa layer did not go cropped at all.

    The result loaded in GM seems to be ok but when you load the result in photoshop you notice that the last (alfa) layer is not crop by the boundary you put in GB.

    Thanks a lot for your new exe but could you please modify it again in order to fix the bug on the alfa layer?

    Kind regards

    Jorge
  • global_mapper
    global_mapper Administrator
    edited January 2011
    Jorge,

    I will take a look and see what is wrong with the cropping of the 4th channel. I'll likely have a fix later today.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • global_mapper
    global_mapper Administrator
    edited January 2011
    Jorge,

    It turned out to be a very easy fix. I have placed a new build at http://www.globalmapper.com/global_mapper12.zip with the change for you to try. Simply download that file and extract the contents into your existing v12.xx installation folder to give it a try. If you are using the 64-bit v12 version there is a new build at http://www.globalmapper.com/global_mapper12_64bit.zip .

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • kuko
    kuko Global Mapper User Trusted User
    edited January 2011
    Mike,

    I have made a new test using for that the new dlls and exe files and now the crop process is correctly even with the 4 th channel (alfa) but a new problem has appeared: the cropped 4th channel is now with black background.

    Thanks for your support.

    Best regards

    Jorge
  • global_mapper
    global_mapper Administrator
    edited January 2011
    Jorge,

    That is to be expected as the background color for Global Mapper only defines defaults for the red, green, and blue color channels. Any channels beyond that don't have any kind of default defined so they are just set to 0 if there isn't any data there. If you also choose to mark background pixels as transparent then an alpha channel will be added to your image to mark those pixels as transparent regardless of color.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • kuko
    kuko Global Mapper User Trusted User
    edited January 2011
    Hi Mike

    I undestand what you´re talking about but, why when did I crop the image when the first exe file you made I got white background in alfa layer?

    With the first exe file GM didn´t crop the alfa layer but it put the background as white in all channels. With the second exe file , GM crops correctly all layers but put the background as black in the 4th (alfa) layer.

    Is it possible use a new exe file which let me to cut correctly all layers and besides put in them the background as white?. This is my dude now.

    Thanks a lot for all your patience with me.

    Regards

    Jorge
  • global_mapper
    global_mapper Administrator
    edited January 2011
    Jorge,

    When you say the 'alfa layer' do you mean the alpha channel or the 4th data band (infrared for RGBI images)? I would expand an alpha channel for transparency to always use either 0 for no-data area or 255 for data areas. Previously the polygon crop wasn't working right for multi-band images, so the alpha channel wasn't correctly marking those areas outside of the actual data as transparent (value of 0) as it should have. You want a value of 0 in your alpha channel where there is no data since that is how you interpret an alpha channel, 0 is no data and 255 is full data.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • kuko
    kuko Global Mapper User Trusted User
    edited January 2011
    Mike,

    You´re in the right way, when I speak of the "alfa layer" I want to say "alpha layer",it´s said I am talking about the infrared or 4th band of the images, sorry for the confusion.

    What I need is that the area where there is no data for all layers (included the 4th layer) has white background.

    With the current exe, the 1st, 2nd and 3rd layer has white background where there is no data after cropping, now I need the same output (background) for the 4th band where there is no data.

    Thank you so much

    Jorge
  • global_mapper
    global_mapper Administrator
    edited January 2011
    Jorge,

    Ok, I understand now, the problem is the 4th band isn't really a "color" band, so it doesn't have a corresponding default in the background color setting for Global Mapper which only has red, green, and blue bands and nothing for other potential data bands. However, I have gone ahead and changed the export so that if your background color is some grayscale value (including white or black), then then grayscale value will also be used as the default for other bands in a multi-band export, so you should now get 255 in the infrared band for your exports if your background color is set to pure white (255,255,255).

    I have placed a new build at http://www.globalmapper.com/global_mapper12.zip with the change for you to try. Simply download that file and extract the contents into your existing v12.xx installation folder to give it a try. If you are using the 64-bit v12 version there is a new build at http://www.globalmapper.com/global_mapper12_64bit.zip .

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • kuko
    kuko Global Mapper User Trusted User
    edited January 2011
    Hello Mike

    The new test using the new exe file has gave me exactly what I needed.

    Thank you so much for all the effort and patience

    See you for the forum.

    Jorge