Author Topic: File Size Limit when "Save As..." to JPEG  (Read 1933 times)

Yuriy Toropin

  • PixInsight Addict
  • ***
  • Posts: 202
    • View Profile
File Size Limit when "Save As..." to JPEG
« on: 2011 November 12 16:17:03 »
Hi,
There are many forums, etc., around that have limit on the attachment size.
Is it possible to add "Desired Size" (KBytes) control to the JPEG Compression group of save dialog (for JPEG format)?
Or pre-calculate size of the file saved at selected quality and show it in the dialog so that achieving desired file size will be one step action instead of trials and errors that have to be done now iteratively.
Thanks a lot,
   Yuriy

Lex

  • PixInsight Old Hand
  • ****
  • Posts: 492
  • Astrophotography rules !!
    • View Profile
Re: File Size Limit when "Save As..." to JPEG
« Reply #1 on: 2011 November 12 18:07:10 »
Yuriy,

That's a good idea, better than checking size in explorer just after saving!

Also my wish    >:D

Clear Skies!!

Lex
______________________________________

CGEM Mount, C11, TS UNC 10" f5, TS Carbon Triplet Apo 90/600, TSOAG 9mm
ATIK 383L+ & EFW2, Lodestar, QHY6,

Observation site 20 km SW of Luxemburg City

RBA

  • PixInsight Old Hand
  • ****
  • Posts: 464
    • View Profile
    • DeepSkyColors
Re: File Size Limit when "Save As..." to JPEG
« Reply #2 on: 2011 November 12 19:04:21 »
This was suggested a while ago and Juan acknowledged it, so I know it's in his radar - I'm just not sure where is this item in the to-do list. But I agree it's a rather useful feature, and the main reason most of my JPEGs are still saved with Photoshop: it takes me less time to load the TIFF file in PS, do a "Save for web and devices" and adjust the compression quality there while looking at the target file size, than going though the iterative process of guessing/saving/checking several times. But of course, it would save me even more time if I could do that without launching another application  8)

Lex

  • PixInsight Old Hand
  • ****
  • Posts: 492
  • Astrophotography rules !!
    • View Profile
Re: File Size Limit when "Save As..." to JPEG
« Reply #3 on: 2011 November 12 19:46:26 »
PS is clearly an option, but as the option comes some 100 bugs the option is rapidly no option anymore  >:D

PI is an will be the only processing tool i will work with  ;D
Clear Skies!!

Lex
______________________________________

CGEM Mount, C11, TS UNC 10" f5, TS Carbon Triplet Apo 90/600, TSOAG 9mm
ATIK 383L+ & EFW2, Lodestar, QHY6,

Observation site 20 km SW of Luxemburg City

RBA

  • PixInsight Old Hand
  • ****
  • Posts: 464
    • View Profile
    • DeepSkyColors
Re: File Size Limit when "Save As..." to JPEG
« Reply #4 on: 2011 November 12 19:58:06 »
PS is clearly an option, but as the option comes some 100 bugs the option is rapidly no option anymore  >:D
PI is an will be the only processing tool i will work with  ;D

That's fine, Lex. I do image processing, I'm not member of any affinity group. I'm not encouraging anyone to use any particular tool, but the "Save as Jpeg" tool in Photoshop to me is more versatile than the one in PixInsight, and I'm not going to do it in PI just for the heck of it, although I know others might. This without getting into the costs issue, that's a separate matter. To me it's all about efficiency - if I want my JPEG files not to exceed certain size, I can get the job done faster in Photoshop, and I don't think quality is going to suffer because of that.

It's not that I'm not loyal to a particular software. It's that I use whatever I think does the job better. Quite a crime for some, but not for me.

PS: I don't understand what you meant about 100 bugs... AFAIK, Photoshop has its own idiosyncrasies and often times likes to do things in a very, um, peculiar way, but I don't think it's a buggy application. I know Juan may send me a PM for saying this, but I get more exception errors with PI than with PS. In fact, ask Steve Lesigh - he got one during the second workshop at AIC the other week. The software did not crash, and that was good, but chances are the little window scared him for a bit. I know it scared me.

Anyway, enough about that....  :angel:

Lex

  • PixInsight Old Hand
  • ****
  • Posts: 492
  • Astrophotography rules !!
    • View Profile
Re: File Size Limit when "Save As..." to JPEG
« Reply #5 on: 2011 November 12 20:16:40 »
Hehe,

No problem, i meant bugs like $  :angel:
As my financial situation is not the best i simply can't buy a costy Soft, that's what i wanted to say..
Clear Skies!!

Lex
______________________________________

CGEM Mount, C11, TS UNC 10" f5, TS Carbon Triplet Apo 90/600, TSOAG 9mm
ATIK 383L+ & EFW2, Lodestar, QHY6,

Observation site 20 km SW of Luxemburg City

RBA

  • PixInsight Old Hand
  • ****
  • Posts: 464
    • View Profile
    • DeepSkyColors
Re: File Size Limit when "Save As..." to JPEG
« Reply #6 on: 2011 November 12 20:38:08 »
Darn it Lex, then don't say 100!  :)
I know there's some "free" copies floating around, but a legit copy of PS for 100 "bugs"?

sleshin

  • PixInsight Old Hand
  • ****
  • Posts: 424
    • View Profile
Re: File Size Limit when "Save As..." to JPEG
« Reply #7 on: 2011 November 12 22:12:19 »
In fact, ask Steve Lesigh - he got one during the second workshop at AIC the other week.

Ya, got the same error once during a run through at home and it didn't crash the program so I was certainly happy it wasn't a problem during the workshop. Didn't occur during the 1st workshop. Closing the error window ended the event without significant consequence so I never figured out the details enough to report it here to Juan. Will certainly do so if it occurs again.

I thought I got rid of the error dialog and moved on pretty quickly. I guess nothing gets by you, at least I know you were paying attention. ;)

BTW, it's Leshin ::)

Steve
Steve Leshin

Stargazer Observatory
Sedona, Arizona

RBA

  • PixInsight Old Hand
  • ****
  • Posts: 464
    • View Profile
    • DeepSkyColors
Re: File Size Limit when "Save As..." to JPEG
« Reply #8 on: 2011 November 12 22:20:28 »
I thought I got rid of the error dialog and moved on pretty quickly. I guess nothing gets by you, at least I know you were paying attention. ;)
Oh I was watching you like a hawk ;)

Nah, seriously, I was having a lot of fun, and yes, you moved away from that situation within 1/2 second and as if nothing happened.

Quote
BTW, it's Leshin ::)
Will never make that mistake again!! My apologies!


Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 3896
    • View Profile
    • http://pixinsight.com/
Re: File Size Limit when "Save As..." to JPEG
« Reply #9 on: 2011 November 18 11:03:06 »
OK, you actually don't need to resort to inferior software products. The attached script will find the maximum possible JPEG quality to write the active image as a JPEG file with the specified target size or less.

This script still has no graphical interface. To use it, open the .js file with the Script Editor and scroll down to lines 125 and 126. Replace the values of the OUTPUT_IMAGE and TARGET_SIZE_KB macros to suit your needs, select the image (it can be a main view or a preview), and run the script (press F9). Detailed information on the achieved file size and JPEG quality will be shown on the console.

Hope this is useful.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Lex

  • PixInsight Old Hand
  • ****
  • Posts: 492
  • Astrophotography rules !!
    • View Profile
Re: File Size Limit when "Save As..." to JPEG
« Reply #10 on: 2011 November 18 13:59:15 »
Thanks Juan, that's a nice feature!
Clear Skies!!

Lex
______________________________________

CGEM Mount, C11, TS UNC 10" f5, TS Carbon Triplet Apo 90/600, TSOAG 9mm
ATIK 383L+ & EFW2, Lodestar, QHY6,

Observation site 20 km SW of Luxemburg City

RBA

  • PixInsight Old Hand
  • ****
  • Posts: 464
    • View Profile
    • DeepSkyColors
Re: File Size Limit when "Save As..." to JPEG
« Reply #11 on: 2011 November 18 14:13:57 »
Being able to set the desired size and being suggested the JPEG quality percentage is actually - for me at least - more useful than the other way around. So thank you!!

Now you know you'll eventually need to embed this in the Save as JPEG dialog, right?
Editing a .js script is not what one would define as intuitive, well designed software ;)
I assume that's the plan and this was just a quick fix for the time being  O:)

oldwexi

  • PixInsight Addict
  • ***
  • Posts: 168
    • View Profile
    • Astronomy Pages G.W.
Re: File Size Limit when "Save As..." to JPEG
« Reply #12 on: 2011 November 18 14:40:06 »
Thanks Juan!
nice script and very useful!

Aloha
Gerald

Enzo De Bernardini

  • PixInsight Addict
  • ***
  • Posts: 213
  • Resistance is futile.
    • View Profile
    • Astronomía Sur
Re: File Size Limit when "Save As..." to JPEG
« Reply #13 on: 2011 December 29 17:26:04 »
Hi,

I added a graphical interface to Juan's script. I hope you find it useful. All credits to Juan, of course. Here a screenshot:


Script file attached.

Best regards,

Enzo.

Edit:
31/12/2011 Error in feature-id corrected.
« Last Edit: 2011 December 31 21:44:50 by Enzo De Bernardini »
Orion SkyviewPro 8" F/5
Orion Shortube 80 mm F/5
Canon EOS 300D
http://astrosurf.com/astronosur

Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 3896
    • View Profile
    • http://pixinsight.com/
Re: File Size Limit when "Save As..." to JPEG
« Reply #14 on: 2011 December 29 18:40:19 »
Man, you're a crack!  8)

Looks very good indeed ;)
Juan Conejero
PixInsight Development Team
http://pixinsight.com/