Re: [Gimp-developer] GPU-accelerated Image Filtering w/ CUDA

2010-08-29 Thread Jacopo Corzani
On 08/29/2010 08:13 PM, Alan Reiner wrote:
> This is a long message, so let me start with the punchline:  *I have a
> lot of CUDA code that harnesses a user's GPU to accelerate very tedious
> image processing operations, potentially 200x speedup.  I am ready to
> donate this code to the GIMP project.  This code can be run on Windows
> or Linux, and probably Mac, too.*  *It only works on NVIDIA cards, but
> can detect at runtime whether the user has acceptable hardware, and
> disables itself if not.*
>
> Hi all, I'm new here.  I work on real-time image processing applications
> that must run at 60-240Hz, which is typically too fast for doing things
> like convolutions on large images.  However, the new fad is to use CUDA
> to harness the parallel computing power of your graphics card to do
> computations, instead of just rendering graphics.  The speed ups are
> phenomenal.
>
> For instance, I implemented a basic convolution algorithm (blurring),
> which operates on a 4096x4096 image with a 15x15 kernel/PSF.  On my CPU
> it took *27 seconds* (AMD Athlon X3 440).  When running the identical
> algorithm in CUDA, I get it done in *0.1 to 0.25 seconds*, so between
> 110x to 250x speedup (NVIDIA GTX 460).  Which side of the spectrum you
> are on depends on whether the memory already resides in the GPU device
> memory, of it needs to be copied in/out on each operation.
>
> Any kind of operation that resembles convolution, such as edge
> detection, blurring, morphology operations, etc, are all highly
> parallelizable and ideal for GPU-acceleration.  *I have a lot of this
> code already written for grayscale images, and can be donated to the
> GIMP project.*  I would be interested to expand the code to work on
> color images (though, I suspect just doing it three times on each
> channel would probably not be ideal), and I don't think it will be that
> hard to integrate into the existing GIMP project (only a couple extra
> libraries need to be added for a user's computer to benefit from it).
>
> Additionally, the CUDA comes with convenient functions for determining
> whether a user has a CUDA-enabled GPU, and can default to regular CPU
> operations if they don't have one.  It can determine how many cards they
> have, select the fastest one, and adjust the function calls to
> accommodate older GPU cards.   Therefore, I believe the code can safely
> be integrated and dynamically enable itself only if it can be used.
>
> My solution is for any image size (within the limit of GPU memory), but
> the kernel/PSF size must be odd and no larger than 25x25.  It's not to
> say larger kernel sizes can't be done in CUDA, but my solution is
> "elegant" for sizes smaller than that, due to having a limited amount of
> shared memory.  I believe it will still work up to a 61x61 kernel but
> with substantial slowdown (though, probably still much faster than
> CPU).  Beyond that, I believe a different algorithm is needed.
>
> I have implemented basic convolution (which assumes 0s outside the edge
> of the image), bilateral filter (which is blurring without destroying
> edges), and most of the basic binary morphological operations
> (kernel-based erode, dilate, opening, closing).  I believe it would be
> possible to develop a morphology plugin, that allows you to start with a
> binary image, and click buttons for erode, dilate, opening, etc, and
> have it respond immediately.  This would allow someone to start with an
> image, and try lots of different combinations of morphological
> operations to determine if their problem can be solved with morphology
> (which usually requires a long and complex sequence of morph ops).
>
> Unfortunately, I don't have much time to become a GIMP developer, but I
> feel like I can still contribute.  I will happily develop the algorithms
> to be run on the GPU, as they will probably benefit my job, too (I'm
> open to suggestions for functions that operate on the whole image, but
> independently).  And I can help with the linking to CUDA libraries,
> which NVIDIA claims can be done quickly by someone with no CUDA experience.
>
> Please let me know if anyone is interested to work with me on this:
> etothe...@gmail.com
>
> -Alan
> ___
> Gimp-developer mailing list
> Gimp-developer@lists.XCF.Berkeley.EDU
> https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
>
Hi Alan,
CUDA comes with a free but propietary license (far away from GPL 
ideology),is strictly system dependent (there are not a freebsd version 
for example) and is not opensource.
It's important to say that CUDA is enabled on certain number of NVIDIA 
chip and not on generic accelerated graphic card,there are a big 
restrictions.
Increase speed but to sacrify portability and code openness adding close 
source library is not a good idea for me, in addiction NVIDIA have a two 
face with opensource community, i don't trust that is reliable if there 
are any problems or suggestions.
At the current

Re: [Gimp-developer] Dummy Layer with particular dynamic effect

2010-08-29 Thread Jacopo Corzani
On 08/29/2010 12:46 PM, David Gowers wrote:
> On Sun, Aug 29, 2010 at 4:24 AM, Jacopo Corzani  wrote:
>
>>  
>>> Well, adjustment layers is what GIMP developers seem to refer to as
>>> "layer abuse" :)
>>>
>>> There are different ways to implement non-destructive editing. Would
>>> you be interested to find out more?
>>>
>>> Alexandre Prokoudine
>>> http://libregraphicsworld.org
>>>
>>>
>>>
>>>
>> Hi Alexandre,
>> i could agree with your consideration of "layer abuse" but adjustment
>> layer is a quick and robust solution to manage effects whenever i want.
>> Changing a curve (or any other "effect") dynamically without duplicate
>> layers would be a great.
>> Sure,i'm interested to find another quick way to handle "effects" during
>> time without do an layer abuse, but i don't have any ideas that speed up
>> work like adj layers... :)
>> Thanks for your response.
>>  
> Peter Sikking has already expressed a way of doing this: you attach a
> list of effects to a layer or layer group.
>
> http://www.mmiworks.net/eng/publications/2007/05/lgm-top-gimp-user-requests_25.html
>
> As he observes, this avoids the problem of 'adjustment layers' not
> actually being layers in any normal sense (that is, their lack of
> content) while allowing the same or greater functionality.
>
This kind of layer's effect stack is currently under develpment (you 
post is dated to may 2007)? . It can be a great step to make gimp 
totally non destructive and easy to use.If this feature is under devel i 
would contribute in a development or test phase. Anyone know 
anything?There is an open task about that?

Jacopo
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


Re: [Gimp-developer] Dummy Layer with particular dynamic effect

2010-08-28 Thread Jacopo Corzani

> Well, adjustment layers is what GIMP developers seem to refer to as
> "layer abuse" :)
>
> There are different ways to implement non-destructive editing. Would
> you be interested to find out more?
>
> Alexandre Prokoudine
> http://libregraphicsworld.org
>
>
>

Hi Alexandre,
i could agree with your consideration of "layer abuse" but adjustment 
layer is a quick and robust solution to manage effects whenever i want.
Changing a curve (or any other "effect") dynamically without duplicate 
layers would be a great.
Sure,i'm interested to find another quick way to handle "effects" during 
time without do an layer abuse, but i don't have any ideas that speed up 
work like adj layers... :)
Thanks for your response.
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


Re: [Gimp-developer] Dummy Layer with particular dynamic

2010-08-28 Thread Jacopo Corzani
Sorry but i don't understand if this possible new feature (adjustment layer) is 
interesting or not?
I would try to do an implementation, but if is useless or not interesting i 
will do other.
What do you think?


This is original message:

---
Message: 1
Date: Sat, 28 Aug 2010 02:05:47 +0200
From: Jacopo Corzani
Subject: [Gimp-developer] Dummy Layer with particular dynamic effect
To: gimp-developer@lists.XCF.Berkeley.EDU
Message-ID:<4c7852db.4040...@gmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Hello,
i think that would be very useful a dummy layer that can contains a particular
effect/operation like curves in order to change parameters in future without
any problems and eventually using a particular mask for handle particular zone
where i don't want this.
In this case is possible to activate or deactivate effects and change that
parameters dynamically without any duplicate image layers with static effects.
The problem may be in a user-defined plugins but for standard operation like 
levels or
curves there isn't or i'm missing somethings?
If i write an effect plugin would be perfect to associate that with this kind 
of dummy layer in order to change parameters/enable/disable/masking/unmasking 
that whenever i want.
Sorry for my english :),i'm not a mother language...

Jack

___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


[Gimp-developer] Dummy Layer with particular dynamic effect

2010-08-27 Thread Jacopo Corzani
Hello,
i think that would be very useful a dummy layer that can contains a particular
effect/operation like curves in order to change parameters in future without
any problems and eventually using a particular mask for handle particular zone
where i don't want this.
In this case is possible to activate or deactivate effects and change that
parameters dynamically without any duplicate image layers with static effects.
The problem may be in a user-defined plugins but for standard operation like 
levels or
curves there isn't or i'm missing somethings?
If i write an effect plugin would be perfect to associate that with this kind 
of dummy layer in order to change parameters/enable/disable/masking/unmasking 
that whenever i want.
Sorry for my english :),i'm not a mother language...

Jack

___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer