title: AskViewImages description: AskViewImages
extracts per‑view raster images from a technical drawing. It returns cropped images of each drawing view (e.g., front/side/isometric/details), preserving local annotations for inspection, review, or UI display. path: tree/main/docs/asks source: view-images.md
AskViewImages
AskViewImages
returns cropped images of the individual views that appear on a technical drawing sheet—such as front/side views, sections, details, and isometrics. These view‑level images are convenient for zoomed inspection, lightweight UI previews, and contextual side‑by‑side review with extracted data.
When to use
This feature is particularly beneficial for:
- Detailed inspections of specific drawing views without loading the full sheet image.
- User experience: quick, pleasant previews while extractions run.
- Focused QA: engineers can verify dimensions, notes, and symbols within a single view.
- UI overlays: render callouts, GD\&T, or OCR hits directly on the cropped view.
ROTATION & COORDINATES
Werk24 normalizes sheet orientation. If you rely on pixel coordinates, base them on the returned view image (and its bounding box on the underlying sheet) to ensure alignment with other asks.
Typical workflow
- Submit a drawing to Werk24 with
AskViewImages
. - Receive a list of view crops per page.
- Persist the images and (optionally) store
bbox_px
to map back to the full sheet. - Present the crops in your UI for rapid inspection or overlay other detections.
Example: Python (concise)
from pathlib import Path
# Hypothetical SDK imports; adjust to your environment
from werk24 import AskViewImages, read_example_drawing
# Load a sample drawing
test_drawing = read_example_drawing()
# Create the request
request = AskViewImages()
# Send the request
results = read_example_drawing(test_drawing, [request])
# Save extracted view images
for response in results.get(AskType.VIEW_IMAGES):
for page_response in results.get("ASK_SHEET_IMAGES", []):
if getattr(page_response, "payload_bytes", None):
out = Path(f"sheet_image_{i:02d}.png")
out.write_bytes(page_response.payload_bytes)
print(f"Wrote {out}")
Best practices
- Pair with sheet images: Keep both the full sheet (
AskSheetImages
) and view crops so users can jump between macro and micro context. - Stable filenames/keys: Use deterministic names like
{drawing_id}/{revision}/views/{page:02d}-{view:03d}.png
. - Client‑side thumbnails: Generate smaller previews for catalogs or search results; load full‑res on demand.
- Overlays: Use
reference_id
along withAskBalloons
to position annotations (balloons, GD\&T, OCR hits) precisely.
Limitations
- Raster, not vector: Crops are rasterized; native PDF vector fidelity is not preserved.
- Detection coverage: Very atypical layouts or faint scans may reduce view detection quality.
Common pairings
AskSheetImages
– maintain page context and orientation.AskBalloons
– render callouts on the cropped views.AskViewports
– identify and index view regions;AskViewImages
gives you the pixels.AskNotes
– extract notes and display them alongside the relevant view image.
FAQ
Are view indices stable across runs? Indices reflect detection order; persist your own canonical IDs if strict stability is required.