Closed (fixed)
Project:
ImageCache Actions
Version:
7.x-1.x-dev
Component:
Canvas Actions Module
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
12 Apr 2010 at 14:12 UTC
Updated:
3 Feb 2016 at 15:12 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dman commentedShouldn't be too hard to add. GD allows for two options
... however they take no arguments, so the amount of blur is a constant AFAIK. This means it probably will NOT blur as much as your example there. Maybe a repeated loop would do that though.
I'm sure there is something similar for imagemagick.
Just not seen the need for it yet...
Comment #2
CoPut commentedAnd while this feature doesn't realized as separate Imagecache Action we can use custom action with following code:
Thank you for a clue, dman!
Comment #3
parasox commentedI tried this code (d7 dev version) and it doesn't work for me. Gives me an error and I have to delete the imagecache style.
Is it incomplete perhaps? Is this not all I have to paste into the custom action box? I don't really code, not sure.
I tried with both GD and ImageMagick selected as my toolkit.
Very much interested in being able to blur images
Comment #4
jthomasbailey commentedA good way of doing it is to just scale down the image and then scale it back up.
Comment #5
luksakGot the same issue as #3. This is not caused by the blur you are trying to add. It is the custom action itself which has got a bug:
@hobgobbler:
Haha, are you serious?
Comment #6
luksakComment #7
jthomasbailey commented@ Lukas yeah, that's what I'm doing and it looks pretty good!
Comment #8
luksakWell, my images get pixeled... I solved this with JS.
Comment #9
yannickooWith JS? How?
Comment #10
luksakBasically I convert an image to a canvas and then blur it. Pixsastic does this.
Comment #11
fietserwinThe bug could not be found by me, I could not even find a db_query_range() in the module code.
So, back to the original feature request: blur effect.
Comment #12
dman commentedthanks for the work you are doing in the queue fietserwin :-)
Comment #13
fietserwinPostponing for now until we have a 7.x-1.0 release out.
Please feel free to post patches/code if you have so. I will be glad to add it.
Comment #14
hartogsmith commentedin case anyone else is still trying, this works in D7 as a custom action:
Comment #15
Anonymous (not verified) commented#14 worked perfectly for me. I bumped up the blur intensity to 10, which was needed for the large images on this project.
Thanks for the snippet!
Anne
Comment #15.0
Anonymous (not verified) commentedRemoved name.
Comment #16
dman commentedhttps://www.drupal.org/project/filtersie advertises this without code. Go for that.
Closing this issue unless there is further interest.
Comment #17
GrantI commented#14 worked for me perfectly. I suggest this method over the other 'none code' modules. I tried several and had no luck, this worked perfectly!
Comment #18
dman commented#14 worked for me too, and interestingly I had need to find and recycle this answer again myself, just this week.
I don't like having to introduce PHP custom code through the UI if it can be helped ... but yeah, it it a pretty simple and useful fix.
Comment #19
idebr commentedConsidering the success of the implementation of #14, I have created a patch that implements the blur effect in the Imagecache Canvas Actions module. This implementation is more straightforward than the FiltersIE module mentioned in #16, since you don't have to implement your own convolution matrix. The only configuration option is the amount of times the Gaussian blur is applied to the image.
@dman/@fietserwin I am not sure if every effect is mentioned in the module description, so I'll leave that part up to you. Thanks for your time in maintaining this project!
Comment #20
deanflory commentedThanks idebr for the excellent blur effect. Much appreciated and needed! I've also considered it might be useful along with dynamic_background to create a "blur up" effect on background images: #2646948: Blur Up tiny blurred loading image that fades to large detailed image when loaded
Comment #21
deanflory commentedI've had success when using the #19 patch so I'd give it a rtbc, though I have not scoured the code to see if there are any downsides (it works, sooo...). Setting as Reviewed & Tested by the Community and see no reason why this shouldn't be included.
Comment #22
deanflory commentedComment #23
fietserwin(int) instead of (float)
- Should be called indirectly via image_toolkit_invoke.
- Imagemagick support is simple to add for blur [though the parameter may get a different meaning :(]:
- why execute the filter amount + 1 times? That's not what the description tells.
- why not in 1 loop, because we only want to check the result of the last invocation? check all calls and exit on 1st error.
- why the GAUSSIAN blur and not the SELECTIVE blur? Did you test both? What are the differences?
NB: http://www.imagemagick.org/Usage/blur/ tells me to better always use the standard blur in IM (not sure if that is the selective blur).
I will make the changes and credit @idebr in the commit message as well.
Comment #24
fietserwinI did some tests. Results so far:
- The selective filter is not going to work,so we stay with the Gaussian filter:

- We could say that the value to pass to Im should be 1/10th of the value passed to GD (50 vs 5):

- But for low values the IM blurring is less than for GD (10 vs 1):

- And for higher values the IM blurring is too much (100 vs 10):

So I guess that for IM I'm going to correct with a smaller multiplication factor but with an offset, something like 5 + 8/10*intensity (in IM the sigma may be a float anyway....)
Comment #26
fietserwinI went for 4 + 0.8 * $intensity ...
Committed, thanks for contributing,and if you are interested in doing some porting to D8: you are welcome on the successor of this module: https://www.drupal.org/project/image_effects.
@idebr: you want a link on our project page, was it your time, your company's time or your client's time?
Comment #27
idebr commented@fietserwin Looks great, thanks! No need for a link on the project page, but thanks for the offer :)
Comment #28
fietserwinOK, I just added a link to your Drupal user page.
Comment #30
Anonymous (not verified) commentedThis is very useful. Any chance of a new release? It's been a while since 1.5.