If an app has business logic that says a 24-bit PNG can never exceed 250KB, is it possible to predict what the largest width & height that the image could be and still fit under the 250KB requirement?

Since there are a lot of variables with color-depth, alpha channels, etc... is it possible to know this? Or to get even close?