View Full Version : ImageMagick based picture reader [updated 18.04.05, sequence feature added]
E-Male
17th February 2005, 12:08
use this mirror please: http://www.blainehelmick.com/hosted/immaavs/immaavs.rar (thx to makoto916)
http://e-rels.dyndns.org/downloads/immaavs.rar
(also inlcudes the effects features: http://forum.doom9.org/showthread.php?s=&threadid=90148 )
single picture:
immareadpic("x:\path\pic.bmp")
animation:
immareadanim("x:\path\anim.gif")
image sequence:
immareadseq("x:\path\seq%3.3d.png", start=5, stop=89, fps=25, textmode=2, posx=50, posy=50)
supported formats (90+):
http://www.imagemagick.org/www/formats.html
the filter will also accept urls and the imagemagick internal pictures like "magick:rose"
the video will be 10 fps & rgb32 (incl alpha)
the filter is only tested roughly, so i'd be happy to hear some results
i still welcome feature request, but only for the avisynth part
for requests to the imagemagick team use the "Discourse Server" (forum) at http://www.imagemagick.org
Wilbert
17th February 2005, 14:14
Cool! So, it's possible to load gif and animated gif in AviSynth?
'll also welcome other feature request
It would be nice if it's possible to load animated PNG (ie MNG) in AviSynth :)
E-Male
17th February 2005, 14:58
MNG is in the format list, so it should work
just try it
E-Male
17th February 2005, 17:09
tested an mng animation
works fine
if you can't get beyond a certain frame, restart vdub
one possible future feature would be correctplayback in avisynth (gif animations are vfr)
but it would be quite some work to figure out the framerate and how often to duplicate each input-frame, so i'll likely only do that on request
Dreassica
17th February 2005, 20:36
Multipage .tif maybe? It doesnt seem to work atm, although normal .tif is supported.
Backwoods
18th February 2005, 03:25
Would it be possible to load a series of photos? Also a TXT file with example scripts or the saved HTML (or MHT) file in the ZIP would be ideal.
E-Male
18th February 2005, 04:12
@Dreassica&all:
I cannot add formats
i only use the coremagick api for reading, i don't decode anythign myself
if it does work in imagemagick but not in the plug-in, it would be a bug, and i'd look into it
@Backwoods:
i'll look into stealing code from imagesequence soon (god bless open source)
i plan to do better releases, with cleaned up source code and readme
but often i'm just to lazy and after something finally works i just want to get it out for people to test
i'll work on myself there
Richard Berg
18th February 2005, 07:50
The DevIL library I chose back in 02 or 03 doesn't seem to be interested in fixing its bugs -- I worked around some of them (e.g. upside-down video in some cases), but it's still far from perfect. I don't think I'll have time to work on AVS core code for awhile, so please feel free to steal from imagesequence and make something better based on imagemagick or whatever you prefer.
Backwoods
18th February 2005, 08:55
Originally posted by E-Male
@Backwoods:
i'll look into stealing code from imagesequence soon (god bless open source)
i plan to do better releases, with cleaned up source code and readme
but often i'm just to lazy and after something finally works i just want to get it out for people to test
i'll work on myself there
I know the feeling. Hopefully you can figure out sequences. Appreciate the effort.
E-Male
18th February 2005, 09:25
ok, i'll see what i can do
E-Male
18th February 2005, 21:03
could someone please test if the alpha channel is imported correctly or inverted?
thx
Wilbert
20th February 2005, 01:10
Yup, the alpha channel is imported correctly. I tried several formats:
jpg, gif_alpha, gif_animated, jng_alpha, mng, png_alpha, tiff_alpha
The only thing i couldn't import (or view with a different viewer) was a mng with alpha channel:
http://pmt.sourceforge.net/jdaa/g_by_nan.mng
from
http://pmt.sourceforge.net/jdaa/demo2.html
E-Male
20th February 2005, 14:15
thx
i'll check that
if it doesn't work in imagemagick i'll make a bugreport
E-Male
20th February 2005, 21:02
that file crashes the imagemagick binaries
i posted a bug report on their forum
E-Male
21st February 2005, 00:52
the guys at ImageMagick are quick, from their forum:
Originally posted by magick
We can reproduce the problem you posted and will have a fix in ImageMagick 6.2.0 Beta by tommorrow.
i'll then make an alternative compil with that beta
Wilbert
21st February 2005, 01:09
That's cool. Thanks!
Btw, is it possible to modify it so that you can also save to those formats (like ImageWriter)?
E-Male
21st February 2005, 01:36
after implementing imagesequence syntax into immaread (or vice versa, whatever is easier) it shouldn't be hard to add an imagewriter feature
i might even add aniamtion output (not saving each frame to one picture-file, but all (selected ones) to one aniamted gif [or other format])
Richard Berg
21st February 2005, 04:40
That would be swell.
Backwoods
21st February 2005, 08:57
Originally posted by Wilbert
That's cool. Thanks!
Btw, is it possible to modify it so that you can also save to those formats (like ImageWriter)?
How would that be possible through AVISynth? I'm probably missing something obvious here.
EDIT: "ImageWriter" ?
E-Male
21st February 2005, 20:45
http://www.avisynth.org/ImageWriter
avisynth filters are c++
so you can just use filewriting in them to write the current frame (or any frame) to a file
i never used imagewriter
but for those who do i can port it to ImageMagick
Backwoods
21st February 2005, 20:58
Yea after I posted I looked into it more and saw that. Sounds great, looking forward to all these features E-Mail. In due time of course.
E-Male
22nd February 2005, 12:05
new version in first post
i didn't have time and nerve to work on my code
but i compiled this with the new ImageMagick version 6.2.0 (and some other settings)
that version no longer crashes on the mentioned mng file
please test and tell me if anything improved or got worse
Wilbert
22nd February 2005, 21:33
Pic loads fine, but i don't see an alpha channel :) But forget about it, other things are more important.
maomao333
26th February 2005, 16:44
immaread plugin is superb!
But the common animated pictures like gif ,mng and psd(Adobe Photoshop) are loaded a little slow so that we can't get continuous frames,I use one method to solve the problem:
v1=CoronaSequence("G:\Sample\pics\png\%.2d.png", start=1, stop=6, fps=12).Loop (15)
v2=immaread("G:\Sample\pics\p24.gif").Loop(35).assumefps(v1,true)
return v1+v2
01.png,02.png......06.png is the sequence units decomposed from p24.gif
%.2d.png is the same as p24.gif so that when the total time is given the number of loops can use arbitrary value : 50=15+35=25+25=10+40=......
It will display at correct framerate(12frm/s) on Media Player Classic and the picture exists for 25 seconds,25=(6*(15+35))/12
Is it possible to add loop numbers as a parameter to immaread after you implementing imagesequence syntax ?
Thanks for your effort!
E-Male
27th February 2005, 10:56
Originally posted by maomao333
Is it possible to add loop numbers as a parameter to immaread after you implementing imagesequence syntax ?
sure, i think that shouldn't be hard to add to both the sequence and the aniamtion version
but i'm not sure if i should do it because there is the loop command in avisynth which does the job
i'll see
what i wonder is:
what is the difference between
---
v1=CoronaSequence("G:\Sample\pics\png\%.2d.png", start=1, stop=6, fps=12).Loop (15)
v2=immaread("G:\Sample\pics\p24.gif").Loop(35).assumefps(v1,true)
return v1+v2
---
and
---
immaread("G:\Sample\pics\p24.gif").Loop(50).assumefps(12)
---
?
maomao333
27th February 2005, 11:57
They are equivalent!
sorry,before i take for the video "fps = 25 " , but it be displayed slowly. So I don't think to add loop and assumefps to immaread directly .
Backwoods
6th March 2005, 08:39
E-Male have you looked into loading multiple images yet?
And with the video to film script, I've been doing testing with it still and have made some changes. Another project caught my eye but that is done. I'll post an update in the V2F (shorten it up a bit) thread this coming week.
E-Male
6th March 2005, 12:55
i've been busy the last view days
i'll post as soon as i coded something
nnigam
24th March 2005, 18:44
If you are going to incorporate imagesequence functionality could you also add the capability to automatically rescale the images to a fixed size. I tried imagesequence to make a dvd of my digital camera imageges, and came across the problem that all images have to be the same resolution. I created a perl script to renumber all the images in sequence, but resizing the images manually is a very painful task.
E-Male
24th March 2005, 20:46
when i finally got my head clear to work on this again i'll look into that
shouldn't be to hard
Richard Berg
25th March 2005, 04:42
I created a perl script to renumber all the images in sequence, but resizing the images manually is a very painful task.
Why? It seems like using a simple tool like Irfanview would be much easier than adding yet another resizer to Avisynth.
buzzqw
25th March 2005, 08:10
just for an all in one optimized script :)
BHH
Mug Funky
25th March 2005, 08:22
didn't see this on the imagemagick list, but CRW and other raw CCD images would be really cool (maybe i should request this of the imagemagick people instead?).
great work, man.
E-Male
25th March 2005, 13:59
Originally posted by Mug Funky
didn't see this on the imagemagick list, but CRW and other raw CCD images would be really cool
(maybe i should request this of the imagemagick people instead?).correct
they got a forum (discourse server) and a mailing-list
i won't do any changes to IM myself (well, i might submit color-curve code to them, but that's it)
for the avisynth plugins i just use IM as it is
nnigam
25th March 2005, 16:56
Originally posted by Richard Berg
Why? It seems like using a simple tool like Irfanview would be much easier than adding yet another resizer to Avisynth.
Thanks, this seems a great product. I wonder how come I never saw this anywhere before. It docs seem limited though. Will dvd/minidvd created with this work on a set top dvd player?
Richard Berg
28th March 2005, 23:14
I'm not sure I understand. Irfanview cannot make DVDs. I suggested it a way (one of many possibilities) for resizing your images before feeding them to Avisynth.
nnigam
29th March 2005, 00:01
Thanks
I got that now. It works great.
Backwoods
30th March 2005, 11:24
Any free time to look into ImageSequence yet?
E-Male
30th March 2005, 15:46
sorry, but no
doom9 is my only regular a/v-forum
so i'll post here as soon as something happens
sorry, for not being productive at the moment
i just get my highs and lows, when i do much or nothing for some time
makoto916
7th April 2005, 23:02
Just ran across this filter and gave it a shot using PNG+Alpha as an overlay over DirectShowSource. It's flawless. In the past I've had to create an alpha mask from the PNG and load that alpha mask separately. That was notoriously slow, but this is remarkably fast and it supports the native alpha in PNG. Beautiful.
I've mirrored the RAR file on my server: (link removed). Hopefully that'll relieve any pressure on E-Male's dyndns connection :)
One problem I am having though is that ImageMagic doesn't seem to read my SVG files properly. The problem is the way I'm using entity references in the document as it works fine if I take these out. Anyone have an idea? http://www.blainehelmick.com/hosted/immaavs/Quicktitle.svg It would be awesome if I could skip the step of using Batik to convert the SVG into PNG and just have AviSynth load them directly with this plugin. The SVG seems to render properly in every viewer I can find except ImageMagic, so I'm a bit stumped.
*EDIT* DLL changed to immaavs. New mirror here (http://www.blainehelmick.com/hosted/immaavs/immaavs.rar).
E-Male
8th April 2005, 11:50
thx for the mirror, will add it to the first post (though i daubt the avs-filter will kill my connection. german standard dsl is bad, but not that bad)
i asume from your post that you've already tried imagemagick itself to make sure it's not an avisynth problem
http://www.imagemagick.org/script/formats.php says:
SVG (http://www.w3.org/Graphics/SVG) - RW - Scalable Vector Graphics - Requires libxml2 (http://xmlsoft.org/) and freetype-2 (http://www.freetype.org/). Note that SVG is a very complex specification so support is still not complete.
so it might be that one or both of the needed apps/libraries are missing
i'm not sure if they are needed on your system while running imagemagick/immaread or if i should have had them here during compilation (i assume ther later, but really don't know)
but it also might just be a matter of SVG support still being incomplete
http://studio.imagemagick.org/discussion-server/ is the place to ask the developers
search for SVG there. it brings up some replies that might help
one says that they are working on SVG, but it's complex
if you only miss one feature, post at least one of your files and they might give it priority
good luck
makoto916
8th April 2005, 18:50
Correct, I've tried loading the SVG into IM and it has this problem. It's odd that it only has the problem when I use an entity reference to text. If I remove the entity, and just type the text twice it works perfectly. I've posted this issue at the forums. I also mentioned another issue where IM doesn't seem to render the SVG with a transparent background instead making it opaque.
For now I'm rendering the SVG into PNG using Batik and getting satisfactory results, but I'd love to skip this step entirely and just use your plugin to load SVG directly into AVISynth.
If you are making any new releases, PM me and I'll be happy to test and host them.
makoto916
9th April 2005, 02:16
Received a reply from the IM people about the issue, their response is "SVG support is quite challenging." :D
I did ask one other question though and that relates to immaread. I didn't realize this (mostly because I didn't read the docs, shameful I know) but by adding the parameter '-background none' it will render an SVG with a transparent background.
Since I can work around my entity problem by just putting the text twice, it would be SWEET to be able to use an SVG directly in AVISynth. All that would be needed is for immaread to support this flag. Does that sound like something that would be hard to implement for a future release? I'd volunteer to do it myself but my programming skills are less than stellar.
E-Male
9th April 2005, 07:19
no need for a ":D", these folks do a good job, but they can't do all at once
so you'd like the '-background none' option added?
i'll look into that, but if it's part of the rendering, not of the reading, it might turn out difficult, so no promisses
makoto916
12th April 2005, 03:41
Oh no doubt, no ill-will intended. I was just expecting that response since they already said SVG support was shaky.
I did all of my conversions from SVG to PNG via Batik, but I'm now having an odd problem where the plugin causes VDub, WMP, or really anything to crash. It only occurs on my hyper-threading enabled machine. It works perfect on all of my other systems and if I disable HT in the BIOS of the system in question, it works. My conclusion is that HT is somehow making the plugin angry. Is this possible or am I missing something obvious?
And thank you for your effort, it's sincerely appreciated.
E-Male
12th April 2005, 09:40
k, sorry, just over-interpreted that smiley
my programming knowledge doesn't go much further than actually writing the c++ code, but i can imagine what causes the problem:
imagemagick has code for single- and multi-threading, and i went for multi-threading because i thought it would be faster
(even though experienced programmers told me:
"if you don't know what you are doing, don't use multithreading")
this would make sense, as it might only cause problems on multi CPU systems (hyper-threading AFAIK simulates a dual cpu system)
so if for exmaple avisynth doesn't like multi-threaded libs in plug-ins we might have already found the problem and the solution (i hope!!)
i'll make a new compile with imagemagick 6.2.1 and single-threaded libs ASAP (ETA tomorrow, but as always no promisses)
HighInBC
12th April 2005, 21:08
I know this is a good distance from what your filter does, but I have always wanted a filter that could take a clip, run it through a set of ImageMagick filters and return the clip.
E-Male
13th April 2005, 06:29
Originally posted by HighInBC
I know this is a good distance from what your filter does, but I have always wanted a filter that could take a clip, run it through a set of ImageMagick filters and return the clip. http://forum.doom9.org/showthread.php?s=&threadid=90148
HighInBC
13th April 2005, 16:18
thanks!
E-Male
13th April 2005, 16:28
updated
-joined both imagemagick plug-ins in one .dll-file
-compiled with imagemagick 6.2.1, single-threaded
-no new features in the plug-in yet, will come in next version
makoto916 please test with hyper-threading
i have troubles working with backgrounds in coremagick, so no improvements there
makoto916
13th April 2005, 18:20
Works.
Tested it also on an HP Dual Xeon so it works with real dual processors as well as HT. If you want to test multi-treading again later I can test on this hardware as it's in my lab.
I have a different duall processor Dell that is still having problems but it's having problems with several AVISynth plugins. I have a feeling it's something to do with the fact it's using PCI-Express. That's just a guess though, and it's clearly just that machine.
Also, mirrors were updated.
E-Male
13th April 2005, 18:49
i'll stick with 6.2.1, stable and single-threaded for now and focus on some internal improvements
i'll later play with the imagemagick part again (also when new [stable] versions are released)
note: image-reading didn't work with the newest beta, so i didn't use it
E-Male
18th April 2005, 20:19
updated
speeded things up (i hope) & split the reader into 3 versions
and yes, one of them has the imagesequence functionality
pictures with size different form the first found one will be resized
please test and report (especially sequences and alpha channels [inverted??])
makoto916
22nd April 2005, 01:03
Mirror Updated (http://www.blainehelmick.com/hosted/immaavs/immaavs.rar)
Sorry for the delay in updating the mirror, I'm at NAB in Las Vegas. And 'Yes' the MPAA, RIAA, and associated industries still have their heads firmly planted in their rear ends.
E-Male
22nd April 2005, 02:24
thx
makoto916
6th May 2005, 00:05
Having a problem reading files with alpha channels. It seems to load fine in WMP but if I load it into any other application such as TMPGEG or VDub I get the following error:
ASSERTION failed!
Program C:\library\bin\VirtualDub\Virtuadub.exe
File: \ImageMagick\magick\cache.c
Line: 438
Expression: image !=(const Image *)NULL
I've uploaded a TIF that I made in Photoshop with a transparent background in case you need to see what I'm using. Link (http://www.blainehelmick.com/hosted/immaavs/blah.tif)
I've tried this on my laptop (2.8ghz non-HT) and a dual processor workstation just to make sure this doesn't have anything to do with the recent threading change.
E-Male
6th May 2005, 01:18
i'll have a look next week (busy the time before)
some more things that might help me:
what command did you use for loading (including parameters)?
did you test it in any other players and apps?
was this error a windows-system-error (app crashed completely) or app internal?
makoto916
6th May 2005, 17:21
I origionally had a lengthy script but I whittled it down to just a couple of lines with the same result. On my Dual Processor machine it crashes instantly no matter what I load it in, VDub, WMP, or TMPEG. But on my laptop it will play in WMP just fine, but as soon as I load it into VDub or TMPEG it crashes. In all cases, the error was identical so I assume the message was external, although the app crashed as well. Actually the apps don't seem to have any error they just close on themselves.
VDub crashes without any error since it looks like the error is external. VDub just simply exits on its own which is definately odd behavior. I did some searching and in this thread (http://forum.doom9.org/showthread.php?s=&threadid=88054&highlight=AVISynth+Xeon) a person complains of an identical problem with a different DLL running on a dual processor system. Of course in this case, the problem happens on a single-processor system as well.
Here's the script I used:
LoadPlugin("C:\Library\bin\avisynth\plugins\immaavs.dll")
immareadpic("blah.tif")
If the file TIF I linked to works fine for you, let me know and I can give more detail about my envionrment in case you think it's something on my end.
E-Male
6th May 2005, 19:57
works for me, in vdubmod
first make sure your dll is the same as mine and redownload from:
http://e-rels.dyndns.org/downloads/immaavs.rar
(just recompiled for sure)
i also had a look at cache.c, and it seemsan imagemagick problem, but i'm not sure
please try with imagemagick itself
WarpEnterprises
18th January 2006, 13:28
maybe I missed it: is the source available for immaavs?
E-Male
18th January 2006, 18:04
i lost the newest source
i'll reconstruct it from the latest i got when i have time, but currently i got none at all
E-Male
24th January 2006, 19:19
http://e-rels.dyndns.org/downloads/immaavs.cpp
slapped some comments into the old source
i hope someone with more time and skills than i will pick up the project
i'll answere any questions on the source here in the thread (public answeres are the best IMO, as more people can benefit)
the code is not very well written, but hte important parts are easy to understand i hope
Archimedes
9th October 2007, 19:16
Is there any newer version of immaavs (compiled with the newest ImageMagick libraries)?
juGGaKNot
22nd June 2009, 15:50
Is there an readme ? how do i set 24 bit and not 32 for bmp ?
a1s2d3f4
29th January 2012, 08:42
Curious if this is still being supported. I wanted to find something that would allow me to quickly create "slide shows" out of my .CRW Mark10D photos (with AVS of course), and this looked like the perfect solution.
But
file = "C:\RAW_DATA\Media\CRW0001.CRW"
immareadpic(file)
returns
---------------------------
VirtualDub Error
---------------------------
Avisynth open failure:
Couldn't open picture!!
(C:\RAW_DATA\Media\test.avs, line 2)
---------------------------
OK
---------------------------
Any ideas?
I definitely tested that ImageMagick supports CRW using their convert.exe.
Thanks.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.