---
title: "sampleImage | Weather SDK | JavaScript maps SDK"
description: "Documentation for Weather JS"
---

> For AI agents: a documentation index is available at [/llms.txt](https://docs-qmgv.pages.dev/llms.txt). Markdown versions of all pages are available by appending .md to any URL.

# Function sampleImage

-   sampleImage(image: HTMLImageElement, x: number, y: number): [Pixel](https://docs-qmgv.pages.dev/sdk-js/modules/weather/api-reference/interfaces/Pixel/)[](#sampleimage)
    
    Get the pixel value of an image at a given position
    
    #### Parameters
    
    -   image: HTMLImageElement
    -   x: number
    -   y: number
    
    #### Returns [Pixel](https://docs-qmgv.pages.dev/sdk-js/modules/weather/api-reference/interfaces/Pixel/)
    
    The pixel as `{r, g, b, a}` in a \[0, 1\] interval (and not in \[0, 255\])
