You'll probably want to look into general non-photorealistic rendering (NPR) algorithms.
This site has many links to excellent papers regarding a variety of NPR techniques. Oil painting is particularly difficult as making it look perfect would likely involve some fluid simulation, but you can most likely fake it (probably similarly to older paint programs' filters to emulate it).
Toon shading would likely be a posterization technique with some edge detection. A lot of tweaking would be involved to make it suitable for general-purpose use in converting any photograph/image.
You'll probably want to look into general non-photorealistic rendering (NPR) algorithms.
This site has many links to excellent papers regarding a variety of NPR techniques. Oil painting is particularly difficult as making it look perfect would likely involve some fluid simulation, but you can most likely fake it (probably similarly to older paint programs' filters to emulate it).
Toon shading would likely be a posterization technique with some edge detection. A lot of tweaking would be involved to make it suitable for general-purpose use in converting any photograph/image.