home *** CD-ROM | disk | FTP | other *** search
/ Amiga Elysian Archive / AmigaElysianArchive.iso / prog / arexx / scripti.lha / 3-DEE / Scripti / General / Negative.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1993-05-19  |  2.1 KB  |  104 lines

  1. /*
  2. -----------------------------------------------------------------------------
  3. This AREXX-Script will make any image negative.
  4.  
  5. Host address: ADPro (Art Department Professional   ®ASDG)
  6. Written by Jan Van Overbeke, 3-DEE, ©1993.
  7. Read the AREXX-Scripti doc, for more info about operation and rights!
  8. -----------------------------------------------------------------------------
  9. */
  10.  
  11. arg filename
  12. if ~ exists(filename)|filename='' then do
  13.     say 'Unable to find the image !!'
  14.     say 'See Ya...'
  15.     say ''
  16.     exit
  17.     end
  18.  
  19. options results
  20. address 'ADPro'
  21. say 'Negative: Written by JAN VAN OVERBEKE, 3-DEE, ©1993'
  22. say 'Image: 'filename
  23. say 'SAVE: IFF Original Colors.'
  24. say ''
  25.  
  26. LFORMAT "UNIVERSAL"
  27. if RC ~=0 then do
  28.     say 'Unable to select the UNIVERSAL loader.'
  29.     say 'See Ya...'
  30.     say ''
  31.     exit
  32.     end
  33.  
  34. say 'Loading.........'
  35. LOAD filename
  36. if RC ~=0 then do
  37.     say 'Had some problems while loading.'
  38.     say 'See Ya...'
  39.     say ''
  40.     exit
  41.     end
  42.  
  43. /* ---- Let's check if the loaded image is 24Bit ---- */
  44. /* -------------------------------------------------- */
  45. IMAGE
  46. help=ADPRO_RESULT
  47. dontrender='ok'
  48. if pos('RENDERED',help)>0|pos('BITPLANE',help)>0 then dontrender='nok'
  49.  
  50. say 'Converting......'
  51. operator Negative
  52. if RC ~= 0 then do
  53.     say 'Unable to select the Negative operator.'
  54.     say 'See Ya...'
  55.     say ''
  56.     exit
  57.     end
  58.  
  59. SFORMAT "IFF"
  60. if RC ~=0 then do
  61.     say 'Unable to select the IFF Saver.'
  62.     say 'See Ya...'
  63.     say ''
  64.     exit
  65.     end
  66.  
  67. /* ---- If the loaded image is not 24bit, ---- */
  68. /* ---- Then adjust palette to colormode  ---- */
  69. /* ----      and render a new image       ---- */
  70. /* ------------------------------------------- */
  71. if dontrender='nok' then do
  72.     render_type
  73.     colors=ADPRO_RESULT
  74.     palette=0
  75.     if colors='HAM' then palette=16
  76.     if colors='HAM8' then palette=64
  77.     if palette=0 then palette=colors
  78.     ptotal palette
  79.     pused palette
  80.  
  81.     EXECUTE
  82.     if RC~=0 then do
  83.         say 'Execute failed.'
  84.         say 'See Ya......'
  85.         say ''
  86.         exit
  87.         end
  88.     say 'Saving IMAGE 'colors'.....'
  89.     savemode='IMAGE'
  90.     end
  91.     else do
  92.         savemode='RAW'
  93.         say 'Saving RAW.....'
  94.          end
  95.  
  96. filename=filename'.new'
  97. SAVE filename savemode
  98. if RC~=0 then do
  99.     say 'Problems while saving: NOT SAVED.'
  100.     say 'See Ya...'
  101.     end
  102. say ''
  103. exit
  104.