Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Animated WebP and AVIF Support#25608

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
asmorkalov merged 21 commits intoopencv:4.xfromsturkmen72:animated_webp_support
Dec 20, 2024
Merged
Changes from1 commit
Commits
Show all changes
21 commits
Select commitHold shift + click to select a range
538b99f
animated webp support
sturkmen72Nov 4, 2024
2ac7f0c
Create imreadanimation usage tutorial
sturkmen72Nov 8, 2024
d990c9c
Update table_of_content_app.markdown
sturkmen72Nov 9, 2024
3ddcedd
Update grfmt_webp.cpp
sturkmen72Dec 4, 2024
8be7608
Update test_webp.cpp
sturkmen72Dec 4, 2024
8d2ee31
Update test_webp.cpp
sturkmen72Dec 4, 2024
ed053e2
Update test_webp.cpp
sturkmen72Dec 6, 2024
0aa39e7
Update test_webp.cpp
sturkmen72Dec 7, 2024
4d855fa
Update grfmt_webp.cpp
sturkmen72Dec 7, 2024
c6304c9
Code review fixes.
asmorkalovDec 17, 2024
8a5d955
Refactor webp tests.
asmorkalovDec 17, 2024
08fa9d2
Check written bytes in WebP back-end
asmorkalovDec 18, 2024
f9b7ebe
change timestamps var name as durations
sturkmen72Dec 18, 2024
8ea9fbb
Update animations.cpp
sturkmen72Dec 18, 2024
e88740d
Update animations.py
sturkmen72Dec 18, 2024
ad59318
Update test_webp.cpp
sturkmen72Dec 18, 2024
bb25864
Update imgcodecs.hpp
sturkmen72Dec 18, 2024
50b418e
Update animations.py
sturkmen72Dec 19, 2024
fd63f7c
Update grfmt_webp.cpp
sturkmen72Dec 19, 2024
2972504
final corrections
sturkmen72Dec 19, 2024
ab3861f
Homogenize writemulti behaviour.
asmorkalovDec 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Update animations.py
  • Loading branch information
@sturkmen72
sturkmen72 authoredDec 18, 2024
commite88740de55d6a454bce658f29b10f1de5b8ce90e
10 changes: 5 additions & 5 deletionssamples/python/tutorial_code/imgcodecs/animations.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,19 +9,19 @@ def main(filename):

# Generate a base image with a specific color
image = np.full((128, 256, 4), (150, 150, 150, 255), dtype=np.uint8)
timestamp = 200
duration = 200
frames = []
timestamps = []
durations = []

# Populate frames and timestamps in the Animation object
for i in range(10):
frame = image.copy()
cv.putText(frame, f"Frame {i}", (30, 80), cv.FONT_HERSHEY_SIMPLEX, 1.5, (255, 100, 0, 255), 2)
frames.append(frame)
timestamps.append(timestamp)
durations.append(duration)

animation_to_save.frames =frames
animation_to_save.timestamps =timestamps
animation_to_save.durations =durations

# Write the animation to file
cv.imwriteanimation("animated_image.webp", animation_to_save, [cv.IMWRITE_WEBP_QUALITY, 100])
Expand All@@ -39,7 +39,7 @@ def main(filename):
while True:
for i, frame in enumerate(animation.frames):
cv.imshow("Animation", frame)
key_code = cv.waitKey(animation.timestamps[i])
key_code = cv.waitKey(animation.durations[i])
if key_code == 27: # Exit if 'Esc' key is pressed
return
## [show_animation]
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp