Short description

It would be nice if the transclusion syntax for images can be enhanced

so you can do things like this:

align=right

It would be nice if you could use normal wikimarkup for the image description. Furthermore it would be good to have to ability to hide/show a toolbar:

Maybe there is a way to integrate (for a first try) the things I developpped for Accessible Moin. Clicking on the icons with the palette renders the image in a special way so people with a color vision deficiency can perceive important details. If this does not help you can also render the image in gray (with an improved algorithm which preserves important details)

AccessibleMoin/ishihara_plates.png

AccessibleMoin/color2gray.png

You find the code here (needs PIL and NumPy): AccessibleMoin/daltonize.py AccessibleMoin/color2gray.py

You can run it from the command line.

One big problem is, that both image correction effects run very slow. And there is no way to optimize that.

Maybe one solution would be to do some (C based) PIL plugin / extension module like http://mail.python.org/pipermail/image-sig/2008-May/005003.html. That might be faster. So we can do something like this:

   1     # For the sake of speed: Try to use binary
   2     try:
   3         import PIL_C2G
   4         im_gray = PIL_C2G.run(im)
   5     except:
   6         im_gray = call_slow_python_implementation(im)

Ok. I have now done a Python/PIL extension module ("Binary"), see C2GExtensionModule.zip. Whereas the Python implementation takes for a certain reference image 3.015s, the C implementation now does it within 0.015s! Wow!

I have now also done a Python/PIL module for the daltonize effect, "), see DaltonizeExtensionModule.zip. This is also quite fast. Whereas the Python implementation takes for the above reference image 6.320s, the C implementation now does it within 0.017s!

Discussion

GreyColor.py shows an action which currently converts all attachment jpg images of a page to grey color images using the method color2gray. The results are stored by the action cache. It can be changed to convert only one submitted image by e.g. using some form element data. To get more speed we do the calculation on a resized image by im.thumbnail((640, 640), Image.ANTIALIAS) to a width or height not bigger than 640. Afterwards it is resized to it's orignial size by im.resize(old_size, Image.ANTIALIAS)

The images are stored at e.g. moin-1.z/wiki/data/cache/wikiconfig/sendcache (z >= 7.1)


CategoryFeatureRequest

MoinMoin: FeatureRequests/EnhanceTransclusionSyntaxForImages (last edited 2008-09-19 20:47:01 by OliverSiemoneit)