I have a simple project with just 2 layers. I want to merge them into 1 layer. But the layer boundaries aren't the same. IN the screen grab of GIMP you see 2 yellow layers. The top layer has a right border that doesn't extend to the right as far as the layer beneath it, which you can see it extending further to the right. When I export this image of 2 layers, the layer right and bottom boundaries show as you can see in the pic. I want to not see those 2 lines, when I export the pic. Is there any way to do this in GIMP?
It is not very clear from your screenshot however
1) These only exist inside Gimp. They are not there when you export to a png or a jpg. The layers are flattened into a single layer image. If you save your work as a Gimp .xcf then layers and other data guides, masks, channels etc are retained in the file.
Depending what is required use
2)Layer -> Layer to Image Size on an active layer. Does what it says. The layer boundary coinsides with the canvas size.
3) Image -> Fit canvas to layers Does what it says. Use it if the layer boundary is outside the canvas size and you want to keep it.
I know understand what was happening. After exporting from GIMP I processed the pics in a different program with a lot of timer savers. The lines appeared when I exported from that program, not GIMP. So what I did was in GIMP, I used the crop tool to get rid of these lines - works perfectly.
I'm combining pics with different resolutions and JPG or PNG. I often run into a problem when importing a pic that I have to use the Fit canvas to layers method to see the whole pic.
Sometimes when I use the GMIC plugin in GIMP, and export, the picture is cut off. That's what happened in this case in this post. So this was a way to solve the problem by combining 2 pics, so I could retrieve the cut off portion. I should have noticed this after exporting the pic that it was slightly cut off.