Custom processing for JPEG (Tone curve, CA ...) - page 3 - Feature Requests - CHDK Forum

Custom processing for JPEG (Tone curve, CA ...)

  • 101 Replies
  • 75751 Views
Re: Custom processing for JPEG (Tone curve, CA ...)
« Reply #20 on: 10 / April / 2008, 03:49:54 »
Advertisements
Deleted
« Last Edit: 22 / April / 2008, 15:57:07 by Barney Fife »
[acseven/admin commented out: please refrain from more direct offensive language to any user. FW complaints to me] I felt it imperative to withdraw my TOTAL participation. Nobody has my permission, nor the right, to reinstate MY posts. Make-do with my quoted text in others' replies only. Bye

Re: Custom processing for JPEG (Tone curve, CA ...)
« Reply #21 on: 11 / April / 2008, 02:48:52 »
After further review of the DCRAW source code it looks like the interpretation is correct.
We should have the following matrix

  (G)(B)
  (R)(G)

For the off line editor - my skills are to limited to produce anything helpful.

Can anybody out there skilled with interactive development experience help contribute a decent curve editor?


Re: Custom processing for JPEG (Tone curve, CA ...)
« Reply #22 on: 22 / April / 2008, 03:16:09 »
Finally I got to finish the curve editor and associated tools... and some test successfully (1 Stop , Gamma correction)

The adjustment of curves can be some home counter intuitive and tricky for color adjustment.
I joined the Windows NT tools for your trial.

Are attached below the tools and the code snippets to be inserted in the trunk.
(I do not have access to update the sources on SVN)

Have fun.

Attachment removed ... to make room for more recent tools
« Last Edit: 11 / July / 2008, 10:06:02 by toinech »

*

Offline wontolla

  • ****
  • 413
  • S3 & G9 & A720
Re: Custom processing for JPEG (Tone curve, CA ...)
« Reply #23 on: 22 / April / 2008, 09:06:32 »
Excelent toinech!

Maybe you want to compile for all cameras so all the people can try it before commiting to trunk. In case there are bugs/suggestions etc.

//for all cameras
gmake batch-zip

Have fun!

*

Offline DataGhost

  • ****
  • 314
  • EOS 40D, S5IS
    • DataGhost.com
Re: Custom processing for JPEG (Tone curve, CA ...)
« Reply #24 on: 22 / April / 2008, 09:53:04 »
By the way will there be any performance gain to have this section replaced by inline assembly?
The code is supposed to slice an 80 bit bloc into 8 blocs of 10 bits to use them as index to replace those 8 blocs of 10 bits and reassembling the whole thing.

I am pretty lame with inline assemble and would need help there.
Maybe, I might have time.... thursday or friday, I can have a look at what your code compiles to and see if it can be done quicker. I have the feeling that gcc will try to do this with about 4 registers (it's hard to calculate register needs and allocate them) so I suspect it's going to have to load a lot from memory (not considering the complete RAW data). Also, your loops are 'wrong', the camera will probably have to recalculate the loop invariant each iteration. If you reverse the loop (start high, do -- until == 0), you're coding 'for the architecture', gcc isn't smart enough to detect this. This might already speed it up a little.
(I've seen an extreme case which required 3 ops for the loop invariant (mov big value, add some, add some more), one for the iterator (add one) and one for the comparison itself (cmp), which was replaced by the one op 'subs iterator, 1' after reversing the loop)

Re: Custom processing for JPEG (Tone curve, CA ...)
« Reply #25 on: 23 / April / 2008, 02:05:48 »
Excelent toinech!

Maybe you want to compile for all cameras so all the people can try it before commiting to trunk. In case there are bugs/suggestions etc.

//for all cameras
gmake batch-zip

Have fun!

Here are some of them (butchered) by me ... as you will see
I have tested with A610 1.00f
Please let me know if your camera is not there - I don't want to overload the post...

I have also updated post#22 with a ApplyCurves tool that will work with multiple camera instead of the A610 only.

Update: If you are not too fond of the butchered version please use the Jucifer release (Thanks Jucifer): yet another personal CHDK build (against trunk revision 387)

Removed some binaries since Jucifer release.
« Last Edit: 07 / July / 2008, 21:21:24 by toinech »

Re: Custom processing for JPEG (Tone curve, CA ...)
« Reply #26 on: 27 / April / 2008, 14:52:15 »
Someone told me about this. I had to check. WOW!

I was hoping was to make posterization FX where 8 12 or 16 colors are used. Solarization where tone ranges are color inverted. Your curve editor doesn't allow for making straight lines. Stair-step and saw-tooth patterns. A single vertical line for monochromatic FX. Things like that.

Could you change the curve editor to have an option for straight lines point to point? Then all the above would be possible.

It also doesn't allow you to move the end points across the top or bottom to clip highs and lows, only the right and left sides to lower contrast. It could be used for histogram adjusts if end-point movement on the other axis was allowed. You could make a busy background all white to remove it. Great for silhouette portrait shots

This is like having a built in photo editor. Save folders full of your favorite special effects. I have to figure out how to do a fake infrared look. That would be neat!

I wonder how curves could be made to mimic glass filters. Is there a place online that publishes the curve patterns for glass filters? It wouldn't be too hard to match those shapes with the editor.

Could the curve editor be made part of CHDK? Load edit and save curves right in the camera?

Re: Custom processing for JPEG (Tone curve, CA ...)
« Reply #27 on: 28 / April / 2008, 02:52:51 »
Someone told me about this. I had to check. WOW!

I was hoping was to make posterization FX where 8 12 or 16 colors are used. Solarization where tone ranges are color inverted. Your curve editor doesn't allow for making straight lines. Stair-step and saw-tooth patterns. A single vertical line for monochromatic FX. Things like that.

Tool is not about color but about level of the primary channels.
You may not get the conversion you want.
I will be curious to see a solarization curve.

Quote
Could you change the curve editor to have an option for straight lines point to point? Then all the above would be possible.

Yes whenever I can get some time for it.
You are welcomed to modify the VB code if you want it quickly. Please let me know,

Quote
It also doesn't allow you to move the end points across the top or bottom to clip highs and lows, only the right and left sides to lower contrast. It could be used for histogram adjusts if end-point movement on the other axis was allowed. You could make a busy background all white to remove it. Great for silhouette portrait shots

By design the end points cannot be moved in X position or deleted. It took me sometimes to get that in the code.
You can add (A,0) and (B,1023) point to clip high and low levels.
You may not get the portrait effect you desire though.

Quote
I wonder how curves could be made to mimic glass filters. Is there a place online that publishes the curve patterns for glass filters? It wouldn't be too hard to match those shapes with the editor.

You can create your own. I am still working on a tool that could help build a curve profile between 2 shoots (one with filter and one without filter).
This was a secondary intention of the curve tool.

Nikon cameras have some loadable tone curves (.NTC files). Not sure if they are for color filters.

Curve may not be sufficient for color filters though. I am still learning about matrix color at this point.

Quote
Could the curve editor be made part of CHDK? Load edit and save curves right in the camera?

Yes
As a newbie I still have to figure it out though. May be in the tool section. Since I do not own the trunk I do not want to mess it up.
Only problem is that it is in VB.

Re: Custom processing for JPEG (Tone curve, CA ...)
« Reply #28 on: 28 / April / 2008, 05:28:02 »
Hi

I might be being an idiot... or just a simple user trying to test this, but where or how do I get the curves into CHDK?  Obviously load them into the CURVES folder on the card and load them from the OSD... But what files am I loading onto the card?

Does anyone have any examples or test curves I can try out?  I am using an A570 with Jucifer's build.

Cheers

Steveo
PS 570IS User
EOS 350D/XT User

*

Offline Jucifer

  • *****
  • 251
  • [A710IS]
Re: Custom processing for JPEG (Tone curve, CA ...)
« Reply #29 on: 28 / April / 2008, 05:54:11 »
create a .cv file with CurvesEditor (in CurveTools.zip)
(custom curves can also be used with raw develop)

 

Related Topics


SimplePortal © 2008-2014, SimplePortal