Opened 9 years ago

Last modified 9 years ago

#4858 new enhancement

Support GIMP curves preset files in curves filter

Reported by: llogan Owned by:
Priority: wish Component: avfilter
Version: git-master Keywords: curves
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

The curves filter can accept Photoshop curves files, but not GIMP curves files.

Attached is a GIMP curves file that increases contrast. Made with GIMP 2.8.14.

Attachments (1)

gimpcurves (13.5 KB ) - added by llogan 9 years ago.
GIMP curves preset file

Download all attachments as: .zip

Change History (2)

by llogan, 9 years ago

Attachment: gimpcurves added

GIMP curves preset file

comment:1 by Ilya87, 9 years ago

If only I could write I a parser!

1 - There are two types of curves in Gimp - Free (drawed by hand) and Smooth.
1.1 - This type stated in (curve (curve-type free) or (curve (curve-type smooth) section for every color channel.
2 - Only 17 points on channel can be set in Smooth mode.
3 - The order of color channels in the file: value, red, green, blue, alpha.
4 - If curve-type smooth is set, then coordinates of points must be read from section (points 34 from the beginning, negative values must be ignored, positive values follow in pair (x y) correspond to the ffmpeg coordinates x/y. -1.000000 0.240854 0.139194 -1.000000 means 0.240854/0.139194 for ffmpeg, 0.045714 0.045249 0.091429 0.095023 means 0.045714/0.045249 0.091429/0.095023 for ffmpeg.
5 - If curve-type free is set, then coordinates of points must be read from section (samples 256. There are only y coordinates stated, so x coordinate is calculated by the following formula: x1=0, x2=1/255, x3=2/255, x4=3/255,...,x256=1
6 - All points coordinates pairs follow strictly (for both curve types) x coordinate ascending order.

Last edited 9 years ago by Ilya87 (previous) (diff)
Note: See TracTickets for help on using tickets.