targa or BMP

This forum is for video and audio help and discussion.

Postby trythil » Tue Oct 23, 2007 1:41 am

post-it wrote:it was found that TGA's could retain their structures up to 14 edits before Degradation could be measured


Code: Select all
#!/usr/bin/env ruby
require 'rubygems'
require 'RMagick'
include Magick

# throw in whatever 64x64 image you want
Original = 'test.tga'
New = 'test_new.tga'
times = 0

while true
  orig = Image.read(Original)[0]
  new = orig
  new.flip!
  new.flip!
  new.write New

  t1 = Image.read(Original)[0].get_pixels 0, 0, 64, 64
  t2 = Image.read(New)[0].get_pixels 0, 0, 64, 64

  raise "Data not equal" if t1 != t2
  puts "checked #{times}"
  times += 1
end


Let me know if that ever stops...
This is a block of text that can be added to posts you make. There is a 512 character limit.
trythil
is
 
Joined: 23 Jul 2002
Location: Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch

Postby trythil » Tue Oct 23, 2007 1:56 am

Well, actually, I meant

Code: Select all
#!/usr/bin/env ruby
require 'rubygems'
require 'ftools'
require 'RMagick'
include Magick

# use whatever 64x64 Targa you want here
Original = 'test.tga'
New = 'test_new.tga'
times = 0

while true
  orig = Image.read(Original)[0]
  new = orig
  new.flip!
  new.flip!
  new.write New

  t1 = Image.read(Original)[0].get_pixels 0, 0, 64, 64
  t2 = Image.read(New)[0].get_pixels 0, 0, 64, 64

  raise "Data not equal" if t1 != t2
  puts "checked #{times}"
  times += 1

  File.copy Original, New
end


(thanks Lantis)

Doesn't really affect the outcome, though.

But this thread's been totally derailed...

===

Targa and BMP both are lossless (assuming you stay within the color depth that each format supports), and both have wide format support. What you use will primarily be dependent on what works best in your workflow.

For example, for me, that usually ends up being stuff like Targa, PNG, or OpenEXR (depending on the required color depth, the programs involved, what kind of data I need to embed, etc.) since I can easily ship that stuff across multiple programs and operating systems.
This is a block of text that can be added to posts you make. There is a 512 character limit.
trythil
is
 
Joined: 23 Jul 2002
Location: Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch

Postby trythil » Tue Oct 23, 2007 1:58 am

trythil wrote:
Code: Select all
  File.copy Original, New



Clearly, I am way too tired to be a jerk, since I've pwned myself twice in this thread. That should, of course, be File.copy New, Original. Bleh. I think it's time for sleep.
This is a block of text that can be added to posts you make. There is a 512 character limit.
trythil
is
 
Joined: 23 Jul 2002
Location: Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch

Previous

Return to Video & Audio Help

Who is online

Users browsing this forum: No registered users and 1 guest