unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* excessively slow image animation
@ 2019-02-13 14:39 Evgeny Zajcev
  2019-02-13 17:03 ` Lars Ingebrigtsen
  2019-02-26 21:18 ` Daniel Pittman
  0 siblings, 2 replies; 10+ messages in thread
From: Evgeny Zajcev @ 2019-02-13 14:39 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1413 bytes --]

I've got multi frame image at http://lgarc.narod.ru/giphy.mp4

And run next code on it:

  (let ((ctime (float-time)))
    (setq img (create-image "~/tmp/giphy.mp4" 'imagemagick nil :scale 1.0))
    (insert-image img)
    (cl-dotimes (index 65)
      (image-show-frame img index 'nocheck)
      (sit-for 0.0))
    (- (float-time) ctime))
  ==> 18.788017988204956

18 seconds to show every frame

Then I simple converted the file to set of bmp files:

  $ time convert ~/tmp/giphy.mp4 ~/tmp/anim1/giphy%05d.bmp
  convert ~/tmp/giphy.mp4 ~/tmp/anim1/giphy%05d.bmp  0,18s user 0,10s
system 117% cpu 0,237 total
  $

And animated on these bmp files:

  (let ((ctime (float-time)))
    (setq img (create-image "~/tmp/anim1/giphy00000.bmp" 'imagemagick nil
:scale 1.0))
    (insert-image img)
    (cl-dotimes (index 65)
      (plist-put (cdr img) :file (format "~/tmp/anim1/giphy%05d.bmp" index))
      (force-window-update)
      (sit-for 0.0))
    (- (float-time) ctime))
  ==> 1.3518333435058594

Now I use method with bmp files.  I would like to use built in `:index'
image property to animate images, however current animation speed is
totally not acceptable.  Can this be fixed, or am I doing something wrong?

Thanks

--Versions--
EMACS: GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.18.9) of 2018-11-13
IM: Version: ImageMagick 6.8.9-9 Q16 x86_64 2018-09-28
http://www.imagemagick.org

-- 
lg

[-- Attachment #2: Type: text/html, Size: 2337 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-02-26 21:50 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-13 14:39 excessively slow image animation Evgeny Zajcev
2019-02-13 17:03 ` Lars Ingebrigtsen
2019-02-13 23:14   ` Alan Third
2019-02-13 23:29     ` Evgeny Zajcev
2019-02-14 18:21       ` Alan Third
2019-02-14 18:41         ` Evgeny Zajcev
2019-02-14  0:30   ` Evgeny Zajcev
2019-02-14  4:30     ` Stefan Monnier
2019-02-26 21:18 ` Daniel Pittman
2019-02-26 21:50   ` Evgeny Zajcev

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).