ios - How to apply filter to image in Swift? -


today i've searched lot it, found i'm still confusing.

for example, have next filter:

enter image description here

the result need be:

enter image description here

how can apply image?

i know how apply such type of effects as: photoeffectnoir, or ciphotoeffectchrome, how can apply matrix(or not know how call it) uiimage?

can me little example?

this hint of answer now; i'll come more details have time.

your first image color lookup table (aka clut), called color cube. it's representation of three-dimensional array x, y, , z coordinates r, g, , b components of input color, , value @ given xyz coordinate output color particular rgb input. (because it's being stored in 2d image, 3d table split slices.)

you can use clut filtering in core image cicolorcube filter. trick in converting clut image right format pass parameter filter.

you can find examples of constructing (rather converting image to) color cube in apple's docs , elsewhere on so.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -