changed get_pixel_threshold function in api to make trimming work. get_pixel_threshold now returns the threshold of one single pixel.