[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-04。"],[],[],null,["# Image inspection and redaction\n\nSensitive Data Protection can inspect for and redact sensitive text and objects in\nimages, according to criteria that you specify.\n\nUsing [infoType detectors](/sensitive-data-protection/docs/infotypes-reference), Sensitive Data Protection inspects\na base64-encoded image and detects sensitive data within\nthe image. Sensitive Data Protection can then return information about the location\nof sensitive data within the image or redact the sensitive data by masking it\nwith an opaque rectangle.\n\nInspection and redaction are two distinct operations:\n\n- *Inspection*: Sensitive Data Protection inspects the submitted base64-encoded image for the specified intoTypes. It returns the detected InfoTypes, along with one or more set of pixel coordinates and dimensions. Each set of pixel coordinate and dimension values indicate the bottom-left corner and the dimensions of bounding boxes, respectively. Each bounding box corresponds to all or part of a Sensitive Data Protection finding.\n- *Redaction*: Sensitive Data Protection inspects the submitted base64-encoded image for the specified infoTypes. Sensitive Data Protection redacts any sensitive data findings by masking them with opaque rectangles. It returns the redacted base64-encoded image in the same image format as the original image. You can also configure the color of the redaction boxes in the request.\n\nAbout image inspection\n----------------------\n\nThe Sensitive Data Protection inspection service accepts a base64-encoded image\nand then searches the image for any data that\nmatches its inspection criteria. Sensitive Data Protection returns the\nlocations of any sensitive data that it detects.\n\nConsider the following image.\n[](/static/sensitive-data-protection/docs/images/objects-in-image.png) Original image (click to enlarge).\n\nThe image inspection process is as follows:\n\n1. You send a [`content.inspect`](/sensitive-data-protection/docs/reference/rest/v2/projects.locations.content/inspect) request to the DLP API. The request contains the base64-encoded image and the inspection configuration, which contains your detection criteria.\n2. Sensitive Data Protection scans the image using the inspection configuration and identifies any matches.\n3. Sensitive Data Protection returns the coordinates and dimensions of the regions within the image where it found sensitive data according to your detection criteria.\n\nThe returned coordinates indicate where to find the sensitive data. Be aware\nthat Sensitive Data Protection often uses multiple boxes to indicate where a single\ninstance of sensitive data is in the image.\n\nIf Sensitive Data Protection doesn't find any data in the image that corresponds\nto your detection criteria, it returns an empty, successful HTTP 200 response.\n\nAbout image redaction\n---------------------\n\nImage redaction is similar to image inspection, with one additional step. After\nSensitive Data Protection identifies the locations of sensitive data within\nthe image, instead of returning the coordinates of the areas that contain the\ndata, it places opaque rectangles on those areas, returning a redacted,\nbase64-encoded image.\n[](/static/sensitive-data-protection/docs/images/objects-redacted.png) Redacted image (click to enlarge).\n\nThe image redaction process is as follows:\n\n1. You send an [`image.redact`](/sensitive-data-protection/docs/reference/rest/v2/projects.locations.image/redact) request to the DLP API. The request contains the base64-encoded image and the image redaction configuration, which contains your detection criteria.\n2. Sensitive Data Protection scans the image using the image redaction configuration and identifies any matches.\n3. Sensitive Data Protection redacts all detected sensitive data by covering it with an opaque rectangle. It then encodes the image in base64 and returns the redacted image in the request response.\n\nIf Sensitive Data Protection doesn't find any data in the image that corresponds\nto your detection criteria, it returns the base64-encoded image unchanged.\n\nWhat's next\n-----------\n\n- Learn how to [inspect images for sensitive data using\n Sensitive Data Protection](/sensitive-data-protection/docs/inspecting-images).\n- Learn how to [redact sensitive data from images using\n Sensitive Data Protection](/sensitive-data-protection/docs/redacting-sensitive-data-images).\n- Learn more about [creating a de-identified copy of data in\n storage](/sensitive-data-protection/docs/concepts-deidentify-storage)."]]