Skip to content

Commit

Permalink
Merge 84c5ea4 into 282b59e
Browse files Browse the repository at this point in the history
  • Loading branch information
aquatiko committed Mar 15, 2019
2 parents 282b59e + 84c5ea4 commit 6a01d4c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
1 change: 1 addition & 0 deletions REQUIRE
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ FITSIO 0.12
FileIO
Images
RecipesBase
Interact
22 changes: 20 additions & 2 deletions src/AstroImages.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ __precompile__()

module AstroImages

using FITSIO, FileIO, Images
using FITSIO, FileIO, Images, Interact

export load, AstroImage
export load, AstroImage, visualize


"""
Expand Down Expand Up @@ -76,4 +76,22 @@ Base.convert(::Type{Matrix{C}}, img::AstroImage{T,C}) where {T,C<:Color} = rende
include("showmime.jl")
include("plot-recipes.jl")

"""
visualize(image::AstroImage)
Visualize the fits image by changing the brightness and contrast of image.
Also, threshold filters out(remove) pixels less than it's value.
"""
function visualize(img::AstroImage{T,C}) where {T,C}
@manipulate for brightness in 0:255, contrast in 1:1000, threshold in 1:255
tmp = img.data/255
@. tmp = (tmp * contrast) + brightness/255

for ind in eachindex(tmp)
tmp[ind] = tmp[ind] >= threshold/255 ? tmp[ind] : 0
end
colorview(Gray, tmp) # Currently for GrayScale images only
end
end

end # module

0 comments on commit 6a01d4c

Please sign in to comment.