please help with adding a value to greyscale image

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
steveh2112
Posts: 2
Joined: 2015-09-28T01:56:49-07:00
Authentication code: 1151

please help with adding a value to greyscale image

Post by steveh2112 »

sorry but i'm new to imagemagick, i hope someone can help a simple task

i have a 16 bit per pixel, greyscale, raw format image (pc format data). (its a heightmap) i need to add a value to every pixel, say add 10, then save back as a raw file.

i think i need to use the math expression feature but can't figure it out, can anyone help?

(by the way, i changed the .raw file to 16 bit .tif and opened it in imagemagick and it looks ok so i can work with tif if its easier)

thx
steveh2112
Posts: 2
Joined: 2015-09-28T01:56:49-07:00
Authentication code: 1151

Re: please help with adding a value to greyscale image

Post by steveh2112 »

i got it,
C:\Program Files\ImageMagick-6.9.2-Q16>.\convert.exe \in.tif -fx '+.01'
c:\Users\me\Desktop\out.tif
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: please help with adding a value to greyscale image

Post by snibgo »

"-evaluate Add" will be much faster:

Code: Select all

convert in.tif -evaluate Add 10 out.tif
snibgo's IM pages: im.snibgo.com
Post Reply