> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Modify Method of the ImageDocument Object

This method modifies the current ImageDocument. All modifications defined by the [ImageModification](/fine-reader/engine/api-reference/image-related-objects/imagemodification) object are possible.

To perform modification, do the following:

1. Create an [ImageModification](/fine-reader/engine/api-reference/image-related-objects/imagemodification) object with the help of the [CreateImageModification](/fine-reader/engine/api-reference/engine-object-iengine-interface/creation-methods/createlessobjectgreater-methods) method of the Engine object.
2. Specify the necessary parameters.
3. Call the Modify method with this object as an input parameter. The actual change takes place only when you call this method.
4. Save the changes using the [IImageDocument::SaveModified](/fine-reader/engine/api-reference/image-related-objects/imagedocument/savemodified-method) method.

<Warning>
  Modifications to the image are not saved until the IImageDocument::SaveModified method is called. If the [ImageDocument](/fine-reader/engine/api-reference/image-related-objects/imagedocument) object is released before a call to this method, the modifications are not saved.
</Warning>

<Warning>
  All blocks must be removed from page layout before this method call. Call the [ILayoutBlocks::DeleteAll](/fine-reader/engine/visual-components-reference/supplementary-objects/spellwordcollection/deleteall-method) method for [ILayout::Blocks](/fine-reader/engine/api-reference/layout-related-objects/layout#blocks) and [ILayout::BlackSeparators](/fine-reader/engine/api-reference/layout-related-objects/layout#blackseparators) , and [ILayout::VisualBlocks](/fine-reader/engine/api-reference/layout-related-objects/layout#visualblocks) (Win) collections of the corresponding layout.
</Warning>

## Syntax

### C++

```cpp theme={null}
HRESULT Modify( IImageModification* Modification );
```

### C\#

```csharp theme={null}
void Modify( IImageModification Modification );
```

### Visual Basic .NET

```vb theme={null}
Sub Modify(Modification As IImageModification)
```

## Parameters

**Modification**

\[in] This variable of the [ImageModification](/fine-reader/engine/api-reference/image-related-objects/imagemodification) type specifies the transformations that are to be performed upon the [ImageDocument](/fine-reader/engine/api-reference/image-related-objects/imagedocument) object.

## Return values

This method has no specific return values. It returns the [standard return values of ABBYY FineReader Engine functions](/fine-reader/engine/api-reference/return-codes).

## Remarks

All the information about the initial image will be lost after the method call.

This method applies modifications to the [black-and-white](/fine-reader/engine/guided-tour/advanced-techniques/working-with-images#black-and-white), [gray](/fine-reader/engine/guided-tour/advanced-techniques/working-with-images#gray), and [color](/fine-reader/engine/guided-tour/advanced-techniques/working-with-images#color) image planes of the [ImageDocument](/fine-reader/engine/api-reference/image-related-objects/imagedocument). All the other pages are deleted from the ImageDocument. They will be created upon demand.

## See also

[ImageModification](/fine-reader/engine/api-reference/image-related-objects/imagemodification)
