NetTalk Central

Author Topic: Niggling problem with FreeImage for Clarion  (Read 6245 times)

Mike Grigsby

  • Sr. Member
  • ****
  • Posts: 380
    • Yahoo Instant Messenger - onthedotsoftware
    • View Profile
    • MyHomeAssets! Software (among others)
Niggling problem with FreeImage for Clarion
« on: November 19, 2013, 08:24:31 AM »
First, I don't think there is a FreeImage forum for Clarion users is there?

I am creating a thumbnail image (so it displays properly in the space allocated on my browse).  So in the form, I have the following code, but it creates a really fuzzy image (not sharp). Does anyone know of a solution for this? I have played with the filters a bit, and it doesn't seem to help. Thanks!

  If p_web.GetValue('USE:PortraitImage')
    If ThumbImage.iImage.Load(clip(p_web.site.WebFolderPath)  & '\' & p_web.GetValue('USE:PortraitImage'))
      ThumbImage.iImage.Thumbnail(220, FILTER_BSPLINE)
      ThumbImage.iImage.SaveAs(clip(p_web.site.WebFolderPath) & '\' & p_web.GetValue('USE:PortraitImage'))
      p_web.SetValue('USE:PortraitImage',p_web.GetValue('USE:PortraitImage'))
      USE:PortraitImage = p_web.GetValue('USE:PortraitImage')
    End
  end
Mike Grigsby
Credify Systems
Central Oregon, USA

Larry Sand

  • Full Member
  • ***
  • Posts: 101
    • View Profile
Re: Niggling problem with FreeImage for Clarion
« Reply #1 on: November 19, 2013, 01:14:27 PM »
Mike,

If your source image is smaller than the image you're trying to make it will be "fuzzy" because the resampling algorithm has to make up the missing bits.  You'll have very good results if you start with an image larger than your thumbnail.  Some filters will yield better results but only marginally.  If your source image is larger than the thumbnail then something else is happening and I'd need to see the image.

Hope that helps,
Larry Sand

Mike Grigsby

  • Sr. Member
  • ****
  • Posts: 380
    • Yahoo Instant Messenger - onthedotsoftware
    • View Profile
    • MyHomeAssets! Software (among others)
Re: Niggling problem with FreeImage for Clarion
« Reply #2 on: November 19, 2013, 01:21:36 PM »
Thanks Larry, The image is almost always larger, and i am pretty familiar with digital images. I know, even in photoshop, if you down sample an image, you sometimes have to sharpen them. Maybe I need to run some sharpening function on it, but havent seen that in Free Image yet.
Mike Grigsby
Credify Systems
Central Oregon, USA

Larry Sand

  • Full Member
  • ***
  • Posts: 101
    • View Profile
Re: Niggling problem with FreeImage for Clarion
« Reply #3 on: November 19, 2013, 04:40:50 PM »
Mike,
Look in the FreeImage docs for the filters, I think Catmull-Rom tends to sharpen.  There are no blur/sharpen functions in the FreeImage library so without an example of your image that's causing the problem there's not much else to do.

Larry Sand

Mike Grigsby

  • Sr. Member
  • ****
  • Posts: 380
    • Yahoo Instant Messenger - onthedotsoftware
    • View Profile
    • MyHomeAssets! Software (among others)
Re: Niggling problem with FreeImage for Clarion
« Reply #4 on: November 20, 2013, 09:20:57 PM »
Thanks so much Larry. I haven't talked with you in years. Weren't you on Team TopSpeed years ago?

Anyway, thanks for the suggestion, and attached is a screen snippet of my terrible looking downsized thumbnails in action.

[attachment deleted by admin]
Mike Grigsby
Credify Systems
Central Oregon, USA

Larry Sand

  • Full Member
  • ***
  • Posts: 101
    • View Profile
Re: Niggling problem with FreeImage for Clarion
« Reply #5 on: November 21, 2013, 10:57:43 AM »
Mike,

Yes it has been a while, and nope I was never on TTS.

Two things:
1) What's the zoom level on your browser,  If it's not 100% set it to that and see if that makes a difference.

2) Does the image control on that page have a width and height attribute?  If so what are they.  If the browser resizes the image then you're going to see artifacts.

Here's an example of a large image down sampled to 200 px wide: http://screencast.com/t/AzkX1cHxF

Could you send an original image to me?

Larry Sand

Mike Grigsby

  • Sr. Member
  • ****
  • Posts: 380
    • Yahoo Instant Messenger - onthedotsoftware
    • View Profile
    • MyHomeAssets! Software (among others)
Re: Niggling problem with FreeImage for Clarion
« Reply #6 on: November 27, 2013, 12:39:05 PM »
Hello Larry, Sorry for the delay. Attached is a screen shot of how the images look (fuzzy) on the browse, and one of the two images that were uploaded and resized using the previously posted code. Thanks for any insight.

[attachment deleted by admin]
Mike Grigsby
Credify Systems
Central Oregon, USA