Page 1 of 2

Images with glowing ends

Posted: 2015-03-30T13:30:49-07:00
by robertkjr3d
How do I tone down the corners, or edges of images. Hot spotting it might sometimes be called. This is specifically caused because of the way these are taken. But cannot be helped. So we want to digitally deal with it. I want to make them more black. However sometimes there can be some detail out there. I've tried some image.vignette and then image.composite, but nothing was leading to any decent results.

Re: Images with glowing ends

Posted: 2015-03-30T13:44:02-07:00
by snibgo
Can you provide a before and after example of the effect you want? You can upload to somewhere like dropbox.com and paste the URLs here.

Re: Images with glowing ends

Posted: 2015-03-30T14:02:29-07:00
by robertkjr3d
https://drive.google.com/folderview?id= ... sp=sharing

See Image1.jpg It has the glowing edges. A image1Sharpen.jpg was produced by another guy with another software technique, that I gave up trying to duplicate (not .NET). But notice it also was doing some cropping. Although it is a little closer to ideal.

The original is in image1.cr2.

Re: Images with glowing ends

Posted: 2015-03-30T16:15:03-07:00
by snibgo
A common technique is to divide the image by a base image, which here would be an x-ray without a foot in the way.

We can sample points of the x-ray where the foot isn't, to make a guess at the base image.

We should work from the best image available, the CR2 file. Code below is Windows BAT syntax. The version of convert in %IMDEV% is assumed to have my "-sparse-color Triangulate" code.

Code: Select all

set SRC=f.png

%IM%convert foot1.cr2 %SRC%

%IM%convert ^
  %SRC% ^
  ( +clone -crop 50x50+100+100 +repage -scale 1x1 +write txt: +delete ) ^
  ( +clone -crop 50x50+1500+100 +repage -scale 1x1 +write txt: +delete ) ^
  ( +clone -crop 50x50+3000+100 +repage -scale 1x1 +write txt: +delete ) ^
  ( +clone -crop 50x50+4500+200 +repage -scale 1x1 +write txt: +delete ) ^
  ( +clone -crop 50x50+5300+200 +repage -scale 1x1 +write txt: +delete ) ^
  ( +clone -crop 50x50+1220+400 +repage -scale 1x1 +write txt: +delete ) ^
  ( +clone -crop 50x50+3000+800 +repage -scale 1x1 +write txt: +delete ) ^
  ( +clone -crop 50x50+4500+800 +repage -scale 1x1 +write txt: +delete ) ^
  ( +clone -crop 50x50+5300+800 +repage -scale 1x1 +write txt: +delete ) ^
  ( +clone -crop 50x50+5300+1500 +repage -scale 1x1 +write txt: +delete ) ^
  ( +clone -crop 50x50+700+2150 +repage -scale 1x1 +write txt: +delete ) ^
  ( +clone -crop 50x50+1500+2500 +repage -scale 1x1 +write txt: +delete ) ^
  ( +clone -crop 50x50+3000+2900 +repage -scale 1x1 +write txt: +delete ) ^
  ( +clone -crop 50x50+4500+2500 +repage -scale 1x1 +write txt: +delete ) ^
  ( +clone -crop 50x50+5300+2500 +repage -scale 1x1 +write txt: +delete ) ^
  ( +clone -crop 50x50+200+3500 +repage -scale 1x1 +write txt: +delete ) ^
  ( +clone -crop 50x50+1500+3500 +repage -scale 1x1 +write txt: +delete ) ^
  ( +clone -crop 50x50+3000+3500 +repage -scale 1x1 +write txt: +delete ) ^
  ( +clone -crop 50x50+4500+3500 +repage -scale 1x1 +write txt: +delete ) ^
  ( +clone -crop 50x50+5300+3500 +repage -scale 1x1 +write txt: +delete ) ^
  NULL: >foot_samps.lis

type foot_samps.lis

( for /F "tokens=6 delims=(),: " %%C in (foot_samps.lis) do @echo %%C ) >foot_samps2.lis

type foot_samps2.lis

%IMDEV%convert ^
  -size 5634x3753 xc: ^
  -sparse-color Triangulate "@foot_samps.csv" ^
  foot_t.png
foot_t.png is the base image. Here is a small version:
Image

Code: Select all

%IM%convert ^
  foot_t.png ^
  %SRC% ^
  -compose Divide -composite ^
  -auto-level -auto-gamma ^
  foot_div.png
foot_div.png is the final output. "-auto-level -auto-gamma" is optional. Here is a small version:
Image

Re: Images with glowing ends

Posted: 2015-03-31T06:17:02-07:00
by robertkjr3d
Your work is pretty. Except it does require rebuilding GM. I have not found any good step-by-step instructions for rebuilding in Windows. I've searched many times, and everything is very cryptic, seems very geered toward linux... or wannabees. Your pages give some brief stuff, but nothing very concrete. Ok I need GCC, but what else do I need to do.

Re: Images with glowing ends

Posted: 2015-03-31T13:15:10-07:00
by snibgo
I provide detailed instructions on building and installing IM with Cygwin, under Windows, on http://im.snibgo.com/compim.htm


Perhaps IM can be built with just GCC, without Cygwin. I don't know.

Re: Images with glowing ends

Posted: 2015-03-31T14:47:14-07:00
by robertkjr3d
I don't think that is an option... These are going to need to be called from a .NET source.

Re: Images with glowing ends

Posted: 2015-04-01T22:27:17-07:00
by dlemstra
Why do you need to rebuild GM when you want to execute the command line code in .NET?

Re: Images with glowing ends

Posted: 2015-04-06T13:54:22-07:00
by robertkjr3d
I realize you are the .NET version master. But it seems to me that the Magick.NET is a bit limited in its functionality compared to the other versions.
.NET can still make external calls to imagemagick (the command-line version) behind the scenes. Just like IM does currently, it uses DCraw.

As does my current code, using an external call.

Re: Images with glowing ends

Posted: 2015-04-06T14:00:20-07:00
by dlemstra
I try to include most functionality from ImageMagick in Magick.NET. Can you elaborate on what you are missing in Magick.NET?

Re: Images with glowing ends

Posted: 2015-04-06T14:05:42-07:00
by robertkjr3d
Oh.. I may be mixing up GraphicsMagick and ImageMagick. And not understanding how they are related.
I need to be on this page: http://www.imagemagick.org/script/install-source.php and figure this out. But some of my words might apply.

Re: Images with glowing ends

Posted: 2015-04-06T14:48:02-07:00
by fmw42
GraphicsMagick and Imagemagick split many many years ago. Today they are quite different with Imagemagick having extended its functionality considerably while GraphicsMagick has stayed pretty much the same.

Re: Images with glowing ends

Posted: 2015-04-07T05:52:53-07:00
by robertkjr3d
ok dlemstra. I have a version of my software already using magick.net. I've not had good success producing good images with it, to be honest.
Nothing like what snilbgo did in just a simple script (at least it seemed simple to him I bet... hehe).

How could I use Magick.net to reproduce his sparse-color triangulate stuff?
Or how much work would it be to do the clone-crops....? Magick.NET has Clone it has Crop.

You know what would be really cool, if Magick.NET has Script Execute... You've probably been asked that before.

Re: Images with glowing ends

Posted: 2015-04-07T13:19:16-07:00
by dlemstra
I apologize, I did not realize that 'sparse-color triangulate' was some custom code from Snibgo. I will take a look and see if we can add this to ImageMagick.

Re: Images with glowing ends

Posted: 2015-04-07T17:50:31-07:00
by snibgo
For source code etc, see my page http://im.snibgo.com/triangul.htm