2016-07-30 33 views
2

我需要通過使用腳本來更改圖像的對比度,但不幸的是我不知道該怎麼做,也許你可以幫助我。在DM腳本中改變圖像的對比度

我搜索的幫助文檔,但結果不得到正確​​的答案

感謝。

回答

0

你最簡單的命令是最有可能SetLimits,像下面的例子:

image img := Realimage("Test",4,256,256) 
img = iradius + icol 
ShowImage(img) 

SetLimits(img, 100, 150) 

,但你可能也想看看例子幫助文檔在imageDisplay部分:

enter image description here

即此示例中:

// create image 
image myImage := Realimage("Test",4,256,256) 
myImage = iradius + icol 
ShowImage(myImage) 

ImageDisplay imageDisp = myImage.ImageGetImageDisplay(0) 

// get display info 
number low, high, bright, contrast 
imageDisp.ImageDisplayGetContrastLimits(low, high) 
imageDisp.ImageDisplayGetContrastParameters(bright, contrast) 

// get color table 
Image colorTable := imageDisp.ImageDisplayGetInputColorTable() 

// modify it 
colorTable = rgb(icol + 16 * irow, 255 - icol - 16 * irow, 128) 

// apply color table 
imageDisp.ImageDisplaySetInputColorTable(colorTable) 
+0

謝謝,我會嘗試在複雜圖像 –

+0

@FabianV上執行此過程。對於複雜的圖像,「模式」也很重要。爲此,使用'ImageDisplayGetComplexMode'和'ImageDisplaySetComplexMode'。 – BmyGuest