title: What is the current limit for Google Cloud Vision API image file size
body: <p>In my Java project I'm using Google Cloud Vision API to extract text from images. For text extraction I'm using the following <a href="https://cloud.google.com/vision/docs/detecting-fulltext#vision-fulltext-detection-gcs-java" rel="nofollow noreferrer">piece of code</a>.</p>
  
  <p>Today, I've found that Google has changed the limits for maximum file size. Previously it was 4 MB. </p>
  
  <p>Now, based on <a href="https://cloud.google.com/vision/quotas" rel="nofollow noreferrer">Quotas and Limits</a> and <a href="https://cloud.google.com/vision/docs/supported-files" rel="nofollow noreferrer">Supported Images</a>, the maximum image file size should be <strong>20 MB</strong> for images hosted on Cloud Storage or at a publicly-accessible URL. Also there is maximum JSON request object size (10 MB). </p>
  
  <p>I'm using option with images hosted on Cloud Storage. For images larger than ~7.95 MB (12000 x 6500) I'm getting an error message:</p>
  
  <pre><code>responses {
    error {
      code: 3
      message: "Invalid image contents: gs://... ."
    }
  }
  </code></pre>
  
  <p>For images with lower size I'm getting correct response. I know that there is a recommended size 1024 x 768 for TEXT_DETECTION and DOCUMENT_TEXT_DETECTION feature but, according to the following note, higher size should not be problem:</p>
  
  <blockquote>
    <p>Note: generally, the Vision API requires images to be a sufficient size so that important features within the request can be easily distinguished. Sizes smaller or larger than these recommended sizes may work. However, smaller sizes may result in lower accuracy, while larger sizes may increase processing time and bandwidth usage without providing comparable benefits in accuracy.</p>
  </blockquote>
  
  <p>Is there something I did not notice? </p>
  
  <p>Note: I'm getting the same error when calling the Vision API directly (see <a href="https://cloud.google.com/vision/docs/auth?authuser=0" rel="nofollow noreferrer">Bearer tokens section</a>).</p>