shape.ApplyEffectInvert() / ApplyEffectGamma() / ApplyEffectPosterize()
Applies color adjustments to a bitmap: invert, gamma, posterize. These are methods on Shape, not on Bitmap — don't go looking on the wrong object.
Signature
shape.ApplyEffectInvert() / ApplyEffectGamma() / ApplyEffectPosterize()
Notes
Applies color adjustments to a bitmap: invert, gamma, posterize. These are methods on Shape, not on Bitmap — don't go looking on the wrong object.
Python example (runnable)
Requires
pywin32. The example assumes app / doc / page / layer are already connected.
See Connection & InitPython
shape = app.ActiveSelectionRange(1)
if shape.Type == 5:
try:
shape.ApplyEffectInvert() # invert
print("Inverted")
except Exception as e:
print("Invert failed: ", e)
try:
shape.ApplyEffectPosterize() # posterise
print("Posterised")
except Exception as e:
print("Posterise failed: ", e)
About this section: Bitmap
Bitmap — raster image handling.
- This section has 8 entries; this is one of them.
- See the full section index: Bitmap
Other entries in this section
- shape.BitmapEntry point to the bitmap sub-object. Check Type == 5 first or access
- bitmap.ResolutionX / ResolutionYHorizontal and vertical resolution in dpi. 300 is the floor for print;
- bitmap.SizeWidth / SizeHeightThe bitmap's size in pixels, not document size. This is how you tell w
- bitmap.ModeColor mode (CMYK, RGB, grayscale, bitmap and so on). The first thing t
- bitmap.Resample(Width, Height, Resolution)Resamples, changing pixel count and resolution. Upscaling invents no d
- shape.ConvertToBitmap(Resolution)Turns a vector object into a bitmap (export and reimport, essentially)
- bitmap.SaveAs(FileName, Filter)Writes the bitmap out to its own file. Batch image extraction, sending