work with pixels directly in javascript