For the same area, I have 2 sets of images, the first is high resolution but it doesn't cover fully the area and the images have somehow uneven borders just like this picture.
The second one has smaller resolution, but practically covers my entire area of interest.
I want to superimpose the high resolution images on the smaller resolution image set, but without having these big black images appearing on the map, so I will have to make the black transparent.
I can batch replace with ImageMagick the black color with transparent, but the problem is cannot make PNG converted from the original JP2 to work on GeoServer, while somehow I had managed to make the GeoServer work for the ECW format converted from the original JP2 files. The original .jp2 files were accompanied by .j2w georeference files.
I have to mention that in order to convert the original JP2 files to PNG I use GDAL with a command line
gdal_translate -of PNG "C:\Users\userDesktop\file.jp2" "C:\Users\userDesktop\file.png"
I have tried using the png.aux.xml and tried not to, tried to copy from the .prj files from another set that worked and tried not to, all to no avail...
Edit: Finally with the help of gdalinfo to make sure during each step the georeference was not lost and after various tries, the correct steps are the following 1) Jp2 to png conversion using GDAL 2) png to png_transparent conversion using ImageMagick 3) png_transparent to ecw conversion using GDAL again.