what parameters of CIVignette mean
Asked Answered
O

3

7

I check CIVignette of Core Image Filter Reference at http://developer.apple.com/library/mac/#documentation/graphicsimaging/reference/CoreImageFilterReference/Reference/reference.html#//apple_ref/doc/filter/ci/CIColorControls

and play around a with the parameters: inputRadius inputIntensity and still have not exactly understood what each parameter effects. Could please someone explain?

Offshore answered 1/12, 2012 at 12:34 Comment(2)
upvoted because apple docu is not sufficientProt
now you have enough reputation to upvote my abswerProt
P
1

Take a look at wiki understand what vignetting in photography means.
It is the fall of of light starting from the center of an image towards the corner.

Apple does not explain much about the the params.

obviously the radius specifies somehow where the vignetitting starts

the param intensity i expect to be how fast the light goes down after vignetting starts.
The radius may not be given in points, a value of 1.0 relates to your picture size.

Prot answered 1/12, 2012 at 12:53 Comment(7)
thank you, but still not getting it.. i set radius to 100 and intensity to 100 and get the following: dropbox.com/s/7po4enfod5f58ah/1.png and then if i set radius to 200 i get the following: dropbox.com/s/pbjtf6gy9lfrxlb/2.png which seems the same...Offshore
sw developpers like parameters between 0 and 1.0 at. so 1 is somehow related to the size of your picture. use radius = 0.8 intensity: play with values 0,5 - 2Prot
thank you again but setting radius below 1 seems that vignette is not applied at all...Offshore
the def values are rad 1, inten 0. try to raise rad slightly: 1.2Prot
if my post was usefull please vote up, and optionally accept.Prot
changing rad to 1.2 and intensity set to 1.8 still seems that no effect is applied. Currently i set rad to 300 and intensity to 1.8 for a good result but still i do not get whether rad is in pixels or percentage or something else... i cannot vote up since vote up requires 15 reputationOffshore
sincevthe default val of rad is 1 it is not in pixels. use intens 0,2 stay near the default valuesProt
D
0

Intensity is definitely something like 1 to 10 or larger number. 1 has some effects, 10 is rather dark already.

The radius seems to be in pixel (or points). I use a portion of image size (says 1/10th of width) and the effect is pretty good! However, if the intensity is strong (says 10), the radius can be small (like 1) and you can still see the different.

Doom answered 25/7, 2014 at 13:24 Comment(0)
S
0

Turns out there is an attributes property on CIFilter that explains its properties and ranges.

let filter = CIFilter(name: "CIVignette")!
print("\(filter.attributes)")

Generates the following output:

[
"CIAttributeFilterDisplayName": Vignette,
"CIAttributeFilterCategories": <__NSArrayI 0x6000037020c0>(
CICategoryColorEffect,
CICategoryVideo,
CICategoryInterlaced,
CICategoryStillImage,
CICategoryBuiltIn
), 
"inputRadius": {
    CIAttributeClass = NSNumber;
    CIAttributeDefault = 1;
    CIAttributeDescription = "The distance from the center of the effect.";
    CIAttributeDisplayName = Radius;
    CIAttributeMax = 2;
    CIAttributeMin = 0;
    CIAttributeSliderMax = 2;
    CIAttributeSliderMin = 0;
    CIAttributeType = CIAttributeTypeScalar;
}, 
"CIAttributeFilterName": CIVignette,
"inputImage": {
    CIAttributeClass = CIImage;
    CIAttributeDescription = "The image to use as an input image. For filters that also use a background image, this is the foreground image.";
    CIAttributeDisplayName = Image;
    CIAttributeType = CIAttributeTypeImage;
},
"inputIntensity": {
    CIAttributeClass = NSNumber;
    CIAttributeDefault = 0;
    CIAttributeDescription = "The intensity of the effect.";
    CIAttributeDisplayName = Intensity;
    CIAttributeIdentity = 0;
    CIAttributeMax = 1;
    CIAttributeMin = "-1";
    CIAttributeSliderMax = 1;
    CIAttributeSliderMin = "-1";
    CIAttributeType = CIAttributeTypeScalar;
}, 
"CIAttributeFilterAvailable_Mac": 10.9, 
"CIAttributeFilterAvailable_iOS": 5, 
"CIAttributeReferenceDocumentation": http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIVignette
]

inputRadius is a float between 0 and 2 that affects the 'size' of the shadow.

inputIntensity is a float between -1 and 1 that affects the 'darkness' of the filter.

Sec answered 18/3, 2022 at 2:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.