Ready! - mcjSkinLikeThis - Script to obtain skin that looks like the skin in a reference photo
Tis Ready ! ! !
https://sites.google.com/site/mcasualsdazscripts5/mcjskinlikethis
and if you have triuble downloading it from my google site
here's a direct link to the zip file
you specify a reference skin image
you select the figure's torso material
you bring your view-camera until the torso skin fills the view
the script will make up to 40 ( but often less ) tiny ( 256x256 ) software or hardware renders
until your rendered material looks like the one in the reference photo
what it does actually is to
- find pixels with the median lightness in the reference image
- notes the average color of those pixels,
- then finds a median-lightness pixel in your rendered image
- notes its location.
- tweaks of your surface diffuse strength
- renders
- it does up to 10 tweak/render cycles until the rendered pixel lightness is the same as the reference image pixels
- for the red, green and blue components of the diffuse color, it does up to 10 tweak/render cycles until the color is just right
Comments
using Kim Kardashian's famous photo from Paper magazine
This looks really useful. Will it be able to work with a photograph for actual skin tones? If so, can you then save them some how for future use?
very tan skin came out a bit too dark i think
the target hue and lightness is taken from any jpg image
you supply any jpg image
ideally an image showing only skin
the script goes through ( many ) all the pixels in the jpg image/photo
and computes the average lightness
then for all the pixels in the image with that lighness, it computes the average hue
then through a series of renders and tweaks it attempts to make the skin of the rendered figure
have the same average lighness, then through a series of renders and tweaks it attempts to make
the skin of the rendered figure have the same hue
Daz Studio has 2 ways to save material settings, the old material presets and the newer .duf format
this is found in the File menu
skin tones from a Ball-joint-doll
( googled this http://bjd-shop.com/blog/wp-content/uploads/2015/01/tan-skin-ipleshouse-carina-bjd-1.jpg )
still looks too dark
i think i'll display the reference image color palette on-screen
and let you pick from it
there ya go
Excellent. I like the option of using either one, but I don't write code (got lost at HTML3) so I have no idea how difficult this is on your end. You've got a great concept here, and it's exciting to watch as you work through it.
One of the applications I can see immediately is that modellers never seem to get skin tones for Native Americans quite right. Living in the capital of the Cherokee Nation, I can get skin sample pictures pretty easy with a couple of phone calls. There are good physical models that need minimum tweaking, but the skin tones are off. I'm hoping your program can help in that.
This is going quite well, and it's exciting to watch. Keep up the great work.
Tony O'seland
aka
Cedarwolf
This is really looking pretty interesting :)
today's test software render will be this image ( fig.1) and ...
searching for an outdoorsy skin reference
---
Fig 2 - the Lynda figure map
Fig 3 - when it starts, the script sets the
diffuse color 192 192 192
ambient color 128 128 128
here the ambient strength is at 20%
the first thing the script will do is adjust the ambient strength so that
the average brightness of the reference and rendered image match
Fig4 the rendered area - i also changed the glossiness to have more bright spots
Fig 5 the Hardware Render ( OpenGL results )
the matching process was forced to use too much "ambient",
i'll have both the diffuse and the ambient color contribute to the match
Still a Hardware-Render skin matching experiment
This time i rely more on the diffuse color strength and less on the ambient strength
we probably keep more shadows ( and contrast ) this way
Next i'll see if i can also match the gold accessories!
------
i'll work on it some more today , still on the Hardware-Render version of it
tomorrow i want to get back to the midi project
and next week get back to the kinect-face-mocap project
then the kinect body mocap project
then i guess the mcjBuilder and the free Gothic music video decor that comes with it and the mcjCastle stairs
then i think it's the physics engine
then the wrapper project, the cage-deformer project
etc etc etc
first skin-matching test using the software renderer
not very good result
technically speaking the result is correct
i.e. the rendered middle skin tone is the same as the reference image
but .... well i have to push the script to make different decisions
maybe the strong glossiness is the problem, it tricks the script into thinking the skin is lighter
-------
Fig 2 - the trial-error method uses a Lo-Hi method to minimize the number of renders needed ( always less than 10 i think )
the renders are kept at 256x256 pixels. Note that the script launches the renders you don't have to touch anything.
and indeed when i removed the specular component of the skin, i get better results which we will discover together in fig. 3
Skin is a bit oily/plastic looking, but the skin tone is much better. The gold looks good.
when i turn the specularity / glossiness / wetness off
before the skin-tone-matching process
i get acceptable results
i guess the release will be Sunday
the skin-matched render above used the ball-joint-doll skin image
this one below uses the tan-skin image
and the Lynda skin tone
and the last software-render skin-tone match, the Kim Kardashian skin tone
fig 2 - all of them together, hardware and software
This is excellent. Turning off those options seems to be just the right step. Tones look good, btw. Well done. Let me know when you are ready for "destructive testing."
it should be ready this evening
the only issue left is to find why sometimes it makes too many trial/error passes before being satisfied with the color match
shown below, it was used to obtain exact rendered clothes colors
using it to get perfect ( software rendered ! ) target colors for clothes
posting the script in the next 30 minutes !
Tis Ready ! ! !
https://sites.google.com/site/mcasualsdazscripts5/mcjskinlikethis
and if you have triuble downloading it from my google site
here's a direct link to the zip file
https://sites.google.com/site/mcasualsdazscripts5/mcjskinlikethis/mcjSkinLikeThis.zip?attredirects=0&d=1
i added the version for DS1 DS2
( and i realised DS2.3-the-meanie had attempted to destroy my DS1.8 recently but i was able to revive it )
https://sites.google.com/site/mcasualsdazscripts5/mcjskinlikethis
Thank You, this looks like a very nice thing. Will have to try it :)
Attention, attention, there will be an update
i did all my development tests on surfaces using the Daz Default Material ( shaders )
but, Genesis figures, for example, use non-default shaders
and this probably prevents the script from working
---
Our colleagues, Azura ( Genesis2 ) and the Kinect stickman will be assisting us
for the script repair
note that you can see this Kinect mocap scene in this Youtube video:
https://www.youtube.com/watch?v=UIJellHPrmQ
-----
oops it's Genesis ( 1 ? ) and the default shader
first test result i get warnings like "QColor::setHsv: HSV parameters out of range"
but it worked anyway , see fif 2 - using the LyndaCarter skin tone, software mode matching
------
Fig 3 - a hardware render match - i discovered little bugs not related to shaders, so you will want version 2
note that the images are filenamed posessed as in "posessed by the kinect"
---
Fig 4 - matched the boots color to the dress
fig 5 - skin matching - software renders ( tip - make everything else in the screen invisible to speed up the renders
well i had to spend some time on the test scene didnt i? of course!
---
version 2 will be released in the next half hour !
now should work fine with all shaders
though you'll have to manually activate the ambient effect for some shaders like HumanSurface
- Update - - Update - - Update - New Version compatible with shaders - Update - - Update - - Update - - Update -
March 16th 2015 5 pm - new version compatible with non-DzDefaultMaterials ( shaders )
in case you don't know, when you create a cube for example, the material applied to its surface is a Daz Default Shader
and Figures like Genesis often have non-default shaders applied to their surfaces
the first version of mcjSkinLikeThis was only able to do business with old-school DazDefaultMaterials
https://sites.google.com/site/mcasualsdazscripts5/mcjskinlikethis
getting this skin-tone took a few trials and errors
but it was worth the effort
one important tip is that the specularity ( shiny reflections must be turned off before the skin-tone matching tests
also, the lighting and/or the ambient strength/color must sometimes be turned up for the script to reach the objectives,
so in your view-camera try to get a range of lighting that is similar to the reference skin tone image
----
and i got to use the free marble textures from DigiDotz
http://www.daz3d.com/forums/discussion/54019/#783841
mixed with Marianne's Supershine shader
http://www.sharecg.com/v/31573/Material-and-Shader/Super-Shine-Shader
the round-cornered blocks are the free very morphable mcjRoundBox props
https://sites.google.com/site/mcasualsdazscripts2/mcjhole-mcjbox-props
the Doric columns are props too and include a stretch morph
https://sites.google.com/site/mcasualsdazscripts5/mcjdoric
the swimsuit for Aiko3 is the mcjA3Maillot
https://sites.google.com/site/mcasualsdazscripts2/mcja3
plus the cutout map
https://sites.google.com/site/mcasualsdazscripts4/maillottoswim
plus the normal map
https://sites.google.com/site/mcasualsdazscripts4/mcjneoprene
plus Marianne's supershine shader
http://www.sharecg.com/v/31573/Material-and-Shader/Super-Shine-Shader
I am planning to try it soon, I have worked with Shape Magic today, had a nice progress. Next is Replictaor script then I will try this. I hope I can learn to use it :)
I tried it to match my skintone. It works very well. See the result with Genesis 2 default textures.
Thank you!
welcome! glad it worked for someone other than me :)