Images with glowing ends

Magick.NET is an object-oriented C# interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick.NET
robertkjr3d
Posts: 13
Joined: 2015-03-30T13:18:25-07:00
Authentication code: 6789

Images with glowing ends

Post by robertkjr3d » 2015-03-30T13:30:49-07:00

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.

snibgo
Posts: 11994
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Images with glowing ends

Post by snibgo » 2015-03-30T13:44:02-07:00

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.
snibgo's IM pages: im.snibgo.com

robertkjr3d
Posts: 13
Joined: 2015-03-30T13:18:25-07:00
Authentication code: 6789

Re: Images with glowing ends

Post by robertkjr3d » 2015-03-30T14:02:29-07:00

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.

snibgo
Posts: 11994
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Images with glowing ends

Post by snibgo » 2015-03-30T16:15:03-07:00

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
snibgo's IM pages: im.snibgo.com

robertkjr3d
Posts: 13
Joined: 2015-03-30T13:18:25-07:00
Authentication code: 6789

Re: Images with glowing ends

Post by robertkjr3d » 2015-03-31T06:17:02-07:00

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.

snibgo
Posts: 11994
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Images with glowing ends

Post by snibgo » 2015-03-31T13:15:10-07:00

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.
snibgo's IM pages: im.snibgo.com

robertkjr3d
Posts: 13
Joined: 2015-03-30T13:18:25-07:00
Authentication code: 6789

Re: Images with glowing ends

Post by robertkjr3d » 2015-03-31T14:47:14-07:00

I don't think that is an option... These are going to need to be called from a .NET source.

User avatar
dlemstra
Posts: 1567
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Images with glowing ends

Post by dlemstra » 2015-04-01T22:27:17-07:00

Why do you need to rebuild GM when you want to execute the command line code in .NET?
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate

robertkjr3d
Posts: 13
Joined: 2015-03-30T13:18:25-07:00
Authentication code: 6789

Re: Images with glowing ends

Post by robertkjr3d » 2015-04-06T13:54:22-07:00

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.

User avatar
dlemstra
Posts: 1567
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Images with glowing ends

Post by dlemstra » 2015-04-06T14:00:20-07:00

I try to include most functionality from ImageMagick in Magick.NET. Can you elaborate on what you are missing in Magick.NET?
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate

robertkjr3d
Posts: 13
Joined: 2015-03-30T13:18:25-07:00
Authentication code: 6789

Re: Images with glowing ends

Post by robertkjr3d » 2015-04-06T14:05:42-07:00

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.

User avatar
fmw42
Posts: 25383
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Images with glowing ends

Post by fmw42 » 2015-04-06T14:48:02-07:00

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.

robertkjr3d
Posts: 13
Joined: 2015-03-30T13:18:25-07:00
Authentication code: 6789

Re: Images with glowing ends

Post by robertkjr3d » 2015-04-07T05:52:53-07:00

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.

User avatar
dlemstra
Posts: 1567
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Images with glowing ends

Post by dlemstra » 2015-04-07T13:19:16-07:00

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.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate

snibgo
Posts: 11994
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Images with glowing ends

Post by snibgo » 2015-04-07T17:50:31-07:00

For source code etc, see my page http://im.snibgo.com/triangul.htm
snibgo's IM pages: im.snibgo.com

Post Reply