exports hdify function, target dimension fallback