# Dealing with Inf or -Inf pixels

Inf **pixels** are a pain, because the empty areas of a render could be inf as well. So sampling the z with an expression node and using the value of an adjacent pixel for each of them will mess up your edges. If possible, try sampling the surrounding area instead. This will leave the edges intact but deal with the odd erroneous pixel.

1 |
isinf(r)? r(x+1,y):r |

1 |
isinf(r)? ((r(x+1,y)+r(x+1,y+1)+r(x+1,y-1)+r(x,y+1)+r(x,y-1)+r(x-1,y+1)+r(x-1,y)+r(x-1,y-1))/8):r |

Dealing with NaN pixels Linearly interpolate animation curves with the lerp() function