Gimptalk - Premier Gimp Community: Saving Tga file - Gimptalk - Premier Gimp Community

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Saving Tga file

#1 User is offline   bugmenot 

  • Member
  • PipPip
  • Group: Members
  • Posts: 11
  • Joined: 23-February 10

Posted 02 August 2012 - 03:34 AM

I am new to gimp, I had a few problems with batch scripts but managed to fix them, right now I have the following problem that I cant overcome:

I am using this script, which I want to use to load all tga files in a folder, resize their canvas, add border and save:

(let* ((filelist (cadr (file-glob pattern 1))))
	(while (not (null? filelist))
		;Load the image 
		(let* ((filename (car filelist))		
			(image (car (gimp-file-load RUN-NONINTERACTIVE filename filename)))
			(drawable 0) (layer 0))
			
		;Change canvas size
		(gimp-image-resize image 360 130 84 13)
		
		;Load border layer above it
		(set! layer (car(gimp-file-load-layer RUN-NONINTERACTIVE image "E:\\Temp\\border.xcf")))
		(gimp-image-insert-layer image layer 0 -1)
; ***  ***********************
; 111		(set! drawable (car (gimp-image-flatten image)))
; 222		(set! drawable (car (gimp-image-merge-visible-layers image EXPAND-AS-NECESSARY)))
		
		;Save
		(gimp-file-save RUN-NONINTERACTIVE image drawable filename filename)
		(gimp-image-delete image))
		(set! filelist (cdr filelist)))))


If I run manually untill the **** line and use the export option in gimp everything works fine.
If I run with the 111 line everything is fine, but instead of the transparent frame I get white area.
If I run with the 222 line everything the transparent are get cropped.


Any ideas???

EDIT:
I found this option
(file-tga-save RUN-NONINTERACTIVE image drawable filename filename 1 0)
instead of
(gimp-file-save RUN-NONINTERACTIVE image drawable filename filename)

still no change, same result as before.

RDIT2:
for illustration purpose here is an image: http://i49.tinypic.com/20f6gdi.jpg i.e. I want to turn surround my tga image with transperant padding

This post has been edited by bugmenot: 02 August 2012 - 07:07 AM

0

#2 User is offline   ofnuts 

  • Moderator GT
  • Group: Moderators
  • Posts: 1,302
  • Joined: 17-October 10
  • LocationLooking over your shoulder :)

Posted 02 August 2012 - 07:04 AM

White background for 111 is expected, the alpha channel is removed.

EXPAND_AS_NECESSARY in 222 seems to be more like "adjust image to layers". Try CLIP_TO_IMAGE or CLIP_To_BOTTOM_LAYER instead.
010011110110011001101110011101010111010001110011
0

#3 User is offline   bugmenot 

  • Member
  • PipPip
  • Group: Members
  • Posts: 11
  • Joined: 23-February 10

Posted 02 August 2012 - 07:16 AM

I tried them all, unfortunately no joy ..

This post has been edited by bugmenot: 02 August 2012 - 07:18 AM

0

#4 User is offline   bugmenot 

  • Member
  • PipPip
  • Group: Members
  • Posts: 11
  • Joined: 23-February 10

Posted 02 August 2012 - 08:21 AM

maybe I need to use flatten image and then define an alpha channel ? the problem is that I am not sure how to do that here.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic