you can do this with MacRuby:
framework 'AppKit'
input_file_path = "/Users/username/Desktop/input_file.png"
img_data = NSData.dataWithContentsOfFile(input_file_path)
bitmap = NSBitmapImageRep.imageRepWithData(img_data)
new_data = bitmap.representationUsingType(NSJPEGFileType, properties: nil) # NSBMPFileType, NSGIFFileType, NSJPEGFileType, NSPNGFileType, or NSTIFFFileType.
output_file_path = "/Users/username/Desktop/output_file.jpeg"
new_data.writeToFile(output_file_path, atomically: true)
and you're done, NSBitmapImageRep#representationUsingType:properties: can takes NSBMPFileType, NSGIFFileType, NSJPEGFileType, NSPNGFileType or NSTIFFFileType for bmp, gif, jpeg, png or tiff