Message 1 of 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Does anyone have a LISP for adjusting an image with Properties-Image Adjust? (brightness/ contrast/ fade)
Solved! Go to Solution.
Does anyone have a LISP for adjusting an image with Properties-Image Adjust? (brightness/ contrast/ fade)
Solved! Go to Solution.
Should be pretty trivial
Have you started writing something or just looking for something existing?
Now I do. The values offered by prompts are from the first img of selection. So if you want to match values of one to many, select the one by a single click, then the rest.
(defun c:ImageAdj ( / s o b c f i e) (if (and (setq s (ssget "_:L" '((0 . "IMAGE")))) (setq b (cond ((getint (strcat "\nBrightness <" (itoa (setq o (getpropertyvalue (ssname s 0) "Brightness"))) ">: "))) (o))) (setq c (cond ((getint (strcat "\nContrast <" (itoa (setq o (getpropertyvalue (ssname s 0) "Contrast"))) ">: "))) (o))) (setq f (cond ((getint (strcat "\nFade <" (itoa (setq o (getpropertyvalue (ssname s 0) "Fade"))) ">: "))) (o))) ) (repeat (setq i (sslength s)) (setq e (ssname s (setq i (1- i)))) (setpropertyvalue e "Brightness" b) (setpropertyvalue e "Contrast" c) (setpropertyvalue e "Fade" f))) (princ) )
Looking for a solution, so I don't have to adjust it manually every time.
Thanks! Where do I put in the values? (b=30, c=70, f=50)
Hardcoded:
@ВeekeeCZ wrote:
...
(defun c:ImageAdj ( / s o b c f i e) (if (and (setq s (ssget "_:L" '((0 . "IMAGE")))) (setq b 30) (setq c 70) (setq f 50) ) (repeat (setq i (sslength s)) (setq e (ssname s (setq i (1- i)))) (setpropertyvalue e "Brightness" b) (setpropertyvalue e "Contrast" c) (setpropertyvalue e "Fade" f))) (princ) )
As its hard coded why have b c f.
(defun c:ImageAdj ( / s i e)
(if (setq s (ssget "_:L" '((0 . "IMAGE"))))
(repeat (setq i (sslength s))
(setq e (ssname s (setq i (1- i))))
(setpropertyvalue e "Brightness" 30)
(setpropertyvalue e "Contrast" 50)
(setpropertyvalue e "Fade" 70))
)
(princ)
)