Skip to content

add gif function #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Apr 14, 2021
Merged

add gif function #30

merged 11 commits into from
Apr 14, 2021

Conversation

johnnychen94
Copy link
Member

@johnnychen94 johnnychen94 commented Mar 9, 2021

Originally proposed in #22 (comment). This is a simple and yet powerful alternative to #29 for 3d image.

Example:

using ImageShow, TestImages, ImageTransformations

# 3d image
ImageShow.gif(testimage("mri-stack"))

# 2d images
toucan = testimage("toucan") # 150×162 RGBA image
moon = testimage("moon") # 256×256 Gray image
ImageShow.gif([toucan, moon])

# a do-function version
img = testimage("cameraman")
ImageShow.gif(-π/4:π/16:π/4]; fps=3) do θ
    imrotate(img, θ, axes(img))
end

@codecov
Copy link

codecov bot commented Mar 11, 2021

Codecov Report

Merging #30 (2fe3bc5) into master (48ababc) will increase coverage by 3.11%.
The diff coverage is 92.85%.

❗ Current head 2fe3bc5 differs from pull request most recent head 29afd4a. Consider uploading reports for the commit 29afd4a to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master      #30      +/-   ##
==========================================
+ Coverage   89.47%   92.59%   +3.11%     
==========================================
  Files           3        4       +1     
  Lines          76      108      +32     
==========================================
+ Hits           68      100      +32     
  Misses          8        8              
Impacted Files Coverage Δ
src/ImageShow.jl 40.00% <ø> (ø)
src/compat.jl 50.00% <50.00%> (ø)
src/gif.jl 95.83% <95.83%> (ø)
src/showmime.jl 96.10% <100.00%> (+1.90%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 48ababc...29afd4a. Read the comment docs.

@timholy
Copy link
Member

timholy commented Mar 12, 2021

What do you see as the main benefit/different in the function-call vs macro form?

@johnnychen94
Copy link
Member Author

johnnychen94 commented Mar 13, 2021

No actual difference; I thought making it a macro is a kind of visual sign to indicate users that this @gif macro is only for "interactive" usage.

@johnnychen94 johnnychen94 changed the title add gif macro add gif function Apr 14, 2021
@johnnychen94 johnnychen94 merged commit a91dcce into master Apr 14, 2021
@ashwanirathee
Copy link
Member

@johnnychen94 Is it possible as of now to show gif properly in ImageInTerminal.jl . Last I tried,it showed the gif as array of images one after another in column..

@johnnychen94 johnnychen94 deleted the jc/gif branch April 14, 2021 14:08
@johnnychen94
Copy link
Member Author

johnnychen94 commented Apr 14, 2021

ImageInTerminal does not understand GIF encoding, so I don't think it's possible as of now. JuliaImages/ImageInTerminal.jl#45 could possibly support it.

This PR is not released yet, I'm working on #29 now and plan to release both as ImageShow v0.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants