added computation for pixel offset