Adding an arrow in my image of M101 Supernova

I have processed my image of the M101 Supernova and am very happy with the results. I was wondering if there is a way in PixInsight to add an arrow pointing to the Supernova?

Comments

  • Not in a way that is designed for this purpose. 
    You can make lines (segments)  and things using PixelMath easily... but you have to put in numbers to place the lines correctly.

    If you have a graphic of an arrow, you can use substitute (script) to put it where you want on the image.. but you need to ignore none arrow pixels when you do it.

    Finally, you can draw an arrow by hand. Using the Clone Stamp tool...this is super easy... but it is likely you are looking for something digital/cleaner.

    -the Blockhead
  • Making lines in Pixelmath might be an option.  I was trying to avoid doing any drawing "by hand". I think I'll play around using Pixelmath.  
  • edited May 2023
    If you are happy with a horizontal arrow you can set up PixelMath as follows:

    Copy the following into the red tab:


    aL = arrowLength/width();
    aW = arrowWidth/height();
    aH = arrowHead/width();
    cX = centreX/width();
    cY = centreY/height();

    inShaft = iif(pointRight == 1,
    ((cX - X ()) < aL) && ((cY -- Y ()) < aW/2) && ((cX - X ()) > abs(cY - Y())),
    ((X() - cX) < aL) && ((cY -- Y()) < aW/2) && ((X() - cX) > abs(cY - Y())));

    inHead = iif(pointRight == 1,
    ((cX - X ()) < aH) && (cX - X () > abs(cY - Y())),
    ((X() - cX) < aH) && (X() - cX > abs(cY - Y())));

    iif(inHead || inShaft, arrowRed, $T);




    In the green and blue tabs copy exactly the same except replace "arrowRed" with "arrowGreen" or "arrowBlue" in the last line.


    Copy the following into the symbols tab:


    pointRight=1,

    arrowLength=300,

    arrowWidth=20,

    arrowHead=40,

    centreX=1456,

    centreY=1908,

    arrowRed = 1,

    arrowGreen = 1,

    arrowBlue = 0,

    inShaft, inHead,

    aL,aW,aH,cX, cY,



    The pointRight parameter can be set to 1 if the arrow is to point right or zero if it is to point left. The next three parameters define how large the arrow will be in pixels. The centreX and centreY parameters define the point to which the arrow head will point in pixel coordinates. The colour of the arrow is defined by setting the arrowRed, arrowGreen and arrowBlue parameters - as written above will produce a yellow arrow (R=1, G=1, B=0).


    CS, Mike



  • edited May 2023
    A slight update to my last comment

    In red:

    aL = arrowLength/width();

    aW = arrowWidth/height();

    aH = arrowHead/width();

    cX = centreX/width();

    cY = centreY/height();


    r = rdist(centreX, centreY);

    a = pangle(centreX, centreY);


    a = a + rotateAngle * pi() / 180;

    rotX = (centreX + r * cos(a)) / width();

    rotY = (centreY + r * sin(a)) / height();


    inShaft = ((cX - rotX) < aL) && ((cY -- rotY) < aW/2) && ((cX - rotX) > abs(cY - rotY));


    inHead = ((cX - rotX) < aH) && ((cX - rotX) > abs(cY - rotY));


    iif(inHead || inShaft, arrowRed, $T);




    Amend the last line for green and blue as before.


    In symbols


    rotateAngle=0,

    arrowLength=300,

    arrowWidth=20,

    arrowHead=40,

    centreX=1456,

    centreY=1908,

    arrowRed = 1,

    arrowGreen = 1,

    arrowBlue = 0,

    inShaft, inHead,

    aL,aW,aH,cX, cY,

    r,a,rotX,rotY




    Now instead of pointRight you have rotateAngle. An angle of zero corresponds to a right pointing arrow. An angle greater than zero will rotate the arrow anti-clockwise by the specified number of degrees about the point it is pointing to. Eg enter rotateAngle=90, will give an arrow pointing upwards.


    CS, Mike

  • Thanks for putting this together. I'll give it a go. I have a busy day today but I will get to it as soon as I can.
  • Got some time this morning and was able to use the PixelMath code you put together. Works fantastic! Thanks so much.
  • I'm glad it worked for you! :)

  • I have created a script that makes this easier - follow this link to the PixInsight forum for more details.  The repository to download the script is: https://www.cosmicphotons.com/pi-scripts/drawannotation/
  • So cool!  Most Excellent.
  • Mike,

    I'm trying to access the link and am getting an "403 Forbidden" error.

    Thanks,

    Ron
  • Ron,

    Add this link to your repository. Do not click on it.
    Then update ..it will download it .
    It works just fine.
    Nice job Mike.
    -the Blockhead
  • Oh silly me... thanks!

    Wow!  A really handy script!

    Thanks!

    Ron
  • Hey Mike the "drawannotation" script is great!  Perhaps an enhancement that allows the user to choose a "circle" instead of the "arrow" at the end of the "pointing line".  For example, I have a photo of NGC7000 and I want to highlight the area of the "Cygnus Wall". I would have a line with a circle (instead of an arrow) around the Cygnus Wall.  Just something I could have used a couple of weeks ago.

    Thanks Darryl

  • Circles are pretty easy:

    Simple Circle
    RGB/K:

    r = sqrt((x()-cx)^2 + (y()-cy)^2); 
    iif(abs(tr-r)<0.5, 1, $T)

    Symbols: cx=500, cy=500, tr=400, r 

    Change its color by adding to the channels.

    -adam
  • Thanks Adam!
  • I have just released an update that now allows you to specify a circle at the end of your arrow.  Enjoy!
    CS, Mike
  • Very Cool. Good work
Sign In or Register to comment.