Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
kaarthic  
#1 Posted : Tuesday, May 23, 2006 12:24:28 AM(UTC)
kaarthic

Rank: Member

Groups: Member
Joined: 5/21/2006(UTC)
Posts: 6

i have tried the overlay method and found that file size is reduced (compressed) in the output file.

Code:
Dim oSource As GraphicsMill.Bitmap
Set oSource = New GraphicsMill.Bitmap
Dim oWatermark1 As GraphicsMill.Bitmap
Set oWatermark1 = New GraphicsMill.Bitmap
Dim oWatermark2 As GraphicsMill.Bitmap
Set oWatermark2 = New GraphicsMill.Bitmap
oSource.LoadFromFile "c:\source.jpg"
oWatermark1.LoadFromFile "c:\scfWatermark.png"
oWatermark2.LoadFromFile "c:\Copyright.png"
oWatermark1.DrawOnBitmap oSource, 300, 10, , , , , , , CombineModeAlphaOverlapped, 150
oWatermark2.DrawOnBitmap oSource, 350, 220, , , , , , , CombineModeAlphaOverlapped, 150
oSource.SaveToFile "c:\output.jpg"


I have also attached the images i have used in the above code, could you please explain why it has compressed the output image or did i missed anything?

Edited by user Wednesday, December 19, 2007 4:38:25 PM(UTC)  | Reason: Not specified

kaarthic attached the following image(s):
source.jpg
scfWatermark.png
Copyright.png
output.jpg
Andrew  
#2 Posted : Tuesday, May 23, 2006 1:02:51 PM(UTC)
Andrew

Rank: Advanced Member

Groups: Member, Administration
Joined: 8/2/2003(UTC)
Posts: 876

Thanks: 2 times
Was thanked: 27 time(s) in 27 post(s)
Image is compressed because you save it to JPEG. JPEG uses lossy image compression algorithm which always reduces file size with quality degradation. This is a reason why it is not recommended to use JPEG as a intermediate file format.

You can manipulate with a compression ratio using the JpegQuality property which can be a number from 0 (worse quality) through 100 (highest quality).


Edited by user Tuesday, December 15, 2009 10:37:24 AM(UTC)  | Reason: Not specified

kaarthic  
#3 Posted : Tuesday, May 23, 2006 11:46:10 PM(UTC)
kaarthic

Rank: Member

Groups: Member
Joined: 5/21/2006(UTC)
Posts: 6

Hi

Thanks for your reply,

Even if i set the JPEQ quality is pixelated the Image. I have set the JPEQ quality to 100

thanks

Kaarthic
Andrew  
#4 Posted : Wednesday, May 24, 2006 5:58:10 PM(UTC)
Andrew

Rank: Advanced Member

Groups: Member, Administration
Joined: 8/2/2003(UTC)
Posts: 876

Thanks: 2 times
Was thanked: 27 time(s) in 27 post(s)
Kaarthic,

I used the following code (see highlighted with bold):

Code:
Dim oSource As GraphicsMill.Bitmap
Set oSource = New GraphicsMill.Bitmap
Dim oWatermark1 As GraphicsMill.Bitmap
Set oWatermark1 = New GraphicsMill.Bitmap
Dim oWatermark2 As GraphicsMill.Bitmap
Set oWatermark2 = New GraphicsMill.Bitmap
oSource.LoadFromFile "c:\source.jpg"
oWatermark1.LoadFromFile "c:\scfWatermark.png"
oWatermark2.LoadFromFile "c:\Copyright.png"
oWatermark1.DrawOnBitmap oSource, 300, 10, , , , , , , CombineModeAlphaOverlapped, 150
oWatermark2.DrawOnBitmap oSource, 350, 220, , , , , , , CombineModeAlphaOverlapped, 150

oSource.FormatAutoSelect = False
oSource.Formats.SelectCurrent "JPEG"
oSource.Formats.JpegQuality = 100
oSource.SaveToFile "c:\output.jpg"


Output image is 112 KB and JPEG artifacts are not visible.

Edited by user Wednesday, December 19, 2007 4:39:13 PM(UTC)  | Reason: Not specified

Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.