ID:1302636
 
(See the best response by LordAndrew.)
Code:
client
New()
..()
sleep(10)
for(var/turf/Turf in world)
if(Turf.name != "turf")
var/obj/Object = new()
var/icon/Icon = icon(Turf.icon, Turf.icon_state)
if(Turf.underlays.len)
for(var/Underlay in Turf.underlays)
Icon.Blend(Underlay:icon, ICON_UNDERLAY)
Icon.Scale(MINIMAP_SIZE / world.maxx, MINIMAP_SIZE / world.maxy)
Object.icon = Icon
Object.pixel_x = (Turf.x - 1) * round(MINIMAP_SIZE / world.maxx)
Object.pixel_y = (Turf.y - 1) * round(MINIMAP_SIZE / world.maxy)
src.mob.underlays += Object


Problem description:

I'm trying to blend the icons of stacked turfs and keep the bottom one as an underlay, but it keeps using the default function for Blend(), which is ICON_ADD.
I'm not 100% sure why it is not doing what you want, but out of curiosity what is this system desired effects?

It appears to be trying to take the turf and all it's underlays and apply it onto the client's mob?
That was just for testing purposes; I'm trying to create a minimap that uses all of the turfs in the world as the background.
Mini-maps can be extremely intensive, and so can icon() procedures.

As for what's going with Blend, I'm not sure- the icon is being added but over the other ones?
Image and video hosting by TinyPic
The left side shows the turfs on the map and the right side shows the result of processing the icons.
The color of the grass edge and the water underneath it gets added together.
What happens when you remove the :icon in the blend so that it is: Icon.Blend(Underlay, ICON_UNDERLAY)
In response to Jittai
Best response
It won't work. I suspect the issue here is that he's trying to use icon operations on appearance data, which is what anything placed in the overlays/underlays list is converted to. You can't conventionally modify things that go into those lists once they're in there.
The DM reffers specifically that the things in underlays/overlays are icons though. :\
In response to Jittai
I get a runtime error if I remove the :icon.
runtime error: bad icon operation
proc name: Blend (/icon/proc/Blend)
usr: null
src: /icon (/icon)
call stack:
/icon (/icon): Blend(, 6, 1, 1)
A Pack of Retards (/client): New()

And it doesn't add the color together, it just omits the water underneath the grass.

PS: I've figured it out, I created a new list and added a copy of all of the underlays to that list, then blended them with the turf's icon.