# ConvertTo-ImageBase64

Converts an image file into a Base64 encoded string.

Project

ImagePlayground

Automate image processing, codes, metadata, charts, topology, and visual stories from PowerShell.

[View on GitHub](https://github.com/EvotecIT/ImagePlayground) [Visit Website](#) [Releases](https://github.com/EvotecIT/ImagePlayground/releases) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/ImagePlayground)

Stars **102**

Forks **7**

Open issues 

Total downloads **708,853**

Release **ImagePlayground-PowerShellModule.v3.2.7**

Language: C# Updated: 2026-11-18

Command 

**Module**

`ImagePlayground`

**Inputs**

`System.String`

**Outputs**

`System.String`

Converts an image file into a Base64 encoded string.

## Syntax

```
ConvertTo-ImageBase64
[-FilePath] <String>
[<CommonParameters>]
```

[#](#method-convertto-imagebase64-string)

Parameter set: `All Parameter Sets`

## Examples

### Get a Base64 string from an image

```powershell
ConvertTo-ImageBase64 -FilePath in.png
```

### Inline conversion and upload

```powershell
$b64 = ConvertTo-ImageBase64 -FilePath photo.jpg; Invoke-RestMethod -Uri https://example/upload -Body $b64
```

## Parameters

**-FilePath String requiredposition: 0pipeline: True (ByValue)**

Path to the image to convert.

## Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see [about_CommonParameters](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:265A68CF0FC42E635EBE0C1958CD4A184348595F52F7490D0246511553E9EFA8 -->
