moved bitmap function to shared lib