Fading Edges of Photos

My game gives the user the option of taking a photo of him- or herself to use as the player sprite. This pulls 500x500 pixels out of the middle of the photo and the sprite displays as 75x75 pixels. I wanted to make the edges of the sprite a bit transparent so that it blends into the background. I couldn’t find an example, so I developed the highly unsophisticated code below. It works OK but I have two questions: 1. How could I have done this more efficiently? 2. Is there a way to do it as a circle? Thanks.
(I use 100 as the FadeWidth.)

function FadePhoto( RawPhoto, FadeWidth ) -- Fades edges of photo
    local RawWidth, RawHeight = spriteSize ( RawPhoto )
    for WidthIndex = 1, RawWidth do  -- Bottom edge
        for HeightIndex = 1, FadeWidth do
            r, g, b, a = RawPhoto:get( WidthIndex, HeightIndex)
            RawPhoto:set( WidthIndex, HeightIndex, r, g, b, HeightIndex * 2.5 ) 
        end   
    end
    for WidthIndex = 1, RawWidth do  -- Top edge
        for HeightIndex = RawHeight, RawHeight - FadeWidth, -1 do
            r, g, b, a = RawPhoto:get( WidthIndex, HeightIndex)
            RawPhoto:set( WidthIndex, HeightIndex, r, g, b, ( RawHeight - HeightIndex ) * 2.5 ) 
        end   
    end
    for WidthIndex = 1, FadeWidth do  -- Left edge
        for HeightIndex = 1, RawHeight do
            r, g, b, a = RawPhoto:get( WidthIndex, HeightIndex)
            RawPhoto:set( WidthIndex, HeightIndex, r, g, b, WidthIndex * 2.5 ) 
        end   
    end
    for WidthIndex = RawWidth, RawWidth - FadeWidth, -1 do  -- Right edge
        for HeightIndex = 1, RawHeight - FadeWidth do
            r, g, b, a = RawPhoto:get( WidthIndex, HeightIndex)
            RawPhoto:set( WidthIndex, HeightIndex, r, g, b, ( RawWidth - WidthIndex ) * 2.5 ) 
        end   
    end
    for WidthIndex = 1, FadeWidth do -- Lower left corner
        for HeightIndex = 1, FadeWidth do
            r, g, b, a = RawPhoto:get( WidthIndex, HeightIndex)
            RawPhoto:set( WidthIndex, HeightIndex, r, g, b, WidthIndex * HeightIndex * (1/FadeWidth) * 2.5 )         
        end
    end
    for WidthIndex = 1, FadeWidth do -- Upper left corner
        for HeightIndex = RawHeight, RawHeight - FadeWidth, -1 do
            r, g, b, a = RawPhoto:get( WidthIndex, HeightIndex)
            RawPhoto:set( WidthIndex, HeightIndex, r, g, b, WidthIndex * (RawHeight - HeightIndex) * (1/FadeWidth) * 2.5 )         
        end
    end
    for WidthIndex = RawWidth, RawWidth - FadeWidth, -1 do -- Upper Right corner
        for HeightIndex = RawHeight, RawHeight - FadeWidth, -1 do
            r, g, b, a = RawPhoto:get( WidthIndex, HeightIndex)
            RawPhoto:set( WidthIndex, HeightIndex, r, g, b, (RawWidth - WidthIndex) * (RawHeight - HeightIndex) * (1/FadeWidth) * 2.5 )         
        end
    end
    for WidthIndex = RawWidth, RawWidth - FadeWidth, -1 do -- Bottom Right corner
        for HeightIndex = 1, FadeWidth do
            r, g, b, a = RawPhoto:get( WidthIndex, HeightIndex)
            RawPhoto:set( WidthIndex, HeightIndex, r, g, b, (RawWidth - WidthIndex) * HeightIndex * (1/FadeWidth) * 2.5 )         
        end
    end
    return( RawPhoto )
end

@DaveW the best way would be to draw a fading on the edges plain ellipse. Then merge it with your image using the appropriate blendmode. Here is a program posted by someone else to punch holes. you probably can tweek it to do your thing

 function setup()
    displayMode(FULLSCREEN)
    board = image(WIDTH-100,HEIGHT-100)
    local mx,my = (WIDTH-100)/7,(HEIGHT-100)/6
    pushStyle()
        --Disable smoothing to stop mixing alphas at edges (creates bug)
        noSmooth()
        --Draw to our board image
        setContext(board)
        --Set colour of the board
        background(40,50,240)

        noStroke()
        fill(0, 0, 0, 255)
        --This is the blend mode:
        blendMode(ZERO,ONE_MINUS_SRC_ALPHA,ZERO,ONE_MINUS_SRC_ALPHA)
        --Draw any primitive after this point that you want to be removed from the board (holes to punch)
        for x=1,7 do
            for y=1,6 do
                ellipse(mx*x-mx/2,my*y-my/2,50)
            end
        end
        setContext()
    popStyle()
end

function draw()
    background(70,50,60)
    --Draw ellipse before board so it appears behind.
    pushStyle()
        fill(50,220,20)
        ellipse(CurrentTouch.x,CurrentTouch.y,80)
    popStyle()
    --Draw the board
    sprite(board,WIDTH/2,HEIGHT/2)
end