ios - How do I create an RGB CIImage from 3 8-bit gray images? -


i have 3 ciimage objects gray 8-bpp images meant 8-bit r, g, , b channels of new image. aside low-level image pixel data operations, there way construct ciimage (from filters or other easier way)

i realize can looping through pixels of new rgb image , setting gray channels have -- wondering if there more idiomatic way work channels.

for example, in pillow python, it's image.merge([rchannel, gchannel, bchannel]) -- know how code pixel access way if there no built in way.

the book, core image swift, covers how , provides code here:

https://github.com/flexmonkey/filterpedia/blob/master/filterpedia/customfilters/rgbchannelcompositing.swift

the basic idea need provide color kernel function in gpu shader language , wrap in cifilter subclass.

note: code not copied here because it's under gpl, incompatible license stackoverflow answers. can follow link if want see how it's done, , use if it's compatible license.


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -