home *** CD-ROM | disk | FTP | other *** search
- /*
- ----------------------------------------------------------------------------
- This AREXX-Script will compose two any images into one.
- Warning! The number of colors is determined by the first argument!
-
- Host address: ADPro (Art Department Pprofessional ®ASDG)
- Written by Jan Van Overbeke, 3-DEE, ©1993.
- Read the AREXX-Scripti doc, for more info about operation and rights!
- ----------------------------------------------------------------------------
- */
-
- options results
- parse arg filename foregroundname offX offY Mix R G B
- if ~ exists(filename)|filename='' then do
- say 'Unable to find the image !!'
- say 'See Ya...'
- say ''
- exit
- end
-
- /* ---- Standard values!!!! ---- */
- /* ----------------------------- */
- if offX='' then offX=0
- if offY='' then offY=0
- if Mix='' then mix=100
- if r='' then r=0
- if g='' then g=0
- if b='' then b=0
-
- /* ---- If the argumented foreground has no path, ---- */
- /* ---- we'll have to add one ---- */
- /* --------------------------------------------------- */
- foreground=foregroundname
- if pos('/',foregroundname)=0 & pos(':',foregroundname)=0 then do
- endpath=lastpos('/',filename)
- if endpath=0 then endpath=lastpos(':',filename)
- foreground=delstr(filename,endpath+1)||foregroundname
- end
-
- if ~exists(foreground)|foreground='' then do
- say 'Unable to find the foreground image.'
- say 'See Ya..........'
- say ''
- exit
- end
-
- address 'ADPro'
- say 'Foreground: Written by JAN VAN OVERBEKE, 3-DEE, ©1993'
- say 'Background: 'filename
- say 'Foreground: 'foreground
- say 'SAVE: IFF Original Colors ->Background.'
- say ''
-
- LFORMAT "UNIVERSAL"
- if RC ~=0 then do
- say 'Unable to select the UNIVERSAL loader.'
- say 'See Ya...'
- say ''
- exit
- end
-
- say 'Loading1.........'
- LOAD filename
- if RC ~=0 then do
- say 'Had some problems while loading.'
- say 'See Ya...'
- say ''
- exit
- end
-
- /* ---- Get some info about image: ---- */
- /* ---- is it gray? is it 24Bit? If not: How many colors? ---- */
- /* ----------------------------------------------------------- */
- IMAGE
- help=ADPRO_RESULT
- dontrender='ok'
- if pos('RENDERED',help)>0|pos('BITPLANE',help)>0 then dontrender='nok'
- if pos('GRAY',help)>0 then do
- say 'Setting color data.....'
- operator gray_to_Color
- if RC~=0 then do
- say 'Gray_To_color Failed!!!!!'
- say 'See Ya.....'
- say ''
- exit
- end
- end
- render_type
- colors=ADPRO_RESULT
-
- say 'Loading2.........'
- LOAD foreground OffX OffY Mix R G B
- if RC ~=0 then do
- say 'Had some problems while loading the foreground.'
- say 'See Ya.'
- say ''
- exit
- end
-
- /* ---- Fine-tune palette to colors of background image ---- */
- /* ---- and render a new one ---- */
- /* --------------------------------------------------------- */
- if dontrender='nok' then do
- say 'Converting......'
- render_type colors
- palette=0
- if colors='HAM' then palette=16
- if colors='HAM8' then palette=64
- if palette=0 then palette=colors
- ptotal palette
- pused palette
- execute
- if RC ~= 0 then do
- say 'Execute failed.'
- say 'See Ya...'
- say ''
- exit
- end
- saveformat='IMAGE'
- say 'Saving IMAGE 'colors'.......'
- end
- else do
- saveformat='RAW'
- say 'Saving RAW.....'
- end
-
- SFORMAT "IFF"
- if RC ~=0 then do
- say 'Unable to select the IFF Saver.'
- say 'See Ya...'
- say ''
- exit
- end
-
- filename=filename'.new'
- SAVE filename saveformat
- if RC~=0 then do
- say 'Problems while saving: NOT SAVED.'
- say 'See Ya...'
- end
- say ''
- exit
-